douqian5553 2014-06-26 16:00
浏览 63

PHP命令在shell命令中执行异步php脚本在bitnami LAMP AWS上不起作用

on my local machine I execute the following:

exec('sudo nohup '.PHP_BINDIR.'/php '.ROOT.'/index.php controller=imports action=import id=12 > /dev/null 2>&1 &');

where "ROOT" is a constant with the complete path.

Everything works fine and the script is executed asyncronously with no problems.

When I run the same script on production environment (a bitnami LAMP stack running on AWS) instead: if I run it directly from the terminal it works, when I run it from php it doesn't.

I have nothing in the apache error_log and if I run it with shell_exec the returned value is NULL.

If I try to execute a different script from php (like exec('whoami')) it works, so I don't think is a permissions thing.

I also tried replacing php command with php-cli, nothing changes.

Hope someone can help.

Thanks in advance.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
    • ¥50 成都蓉城足球俱乐部小程序抢票
    • ¥15 yolov7训练自己的数据集
    • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
    • ¥15 电力市场出清matlab yalmip kkt 双层优化问题