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 求daily translation(DT)偏差订正方法的代码
    • ¥15 js调用html页面需要隐藏某个按钮
    • ¥15 ads仿真结果在圆图上是怎么读数的
    • ¥20 Cotex M3的调试和程序执行方式是什么样的?
    • ¥20 java项目连接sqlserver时报ssl相关错误
    • ¥15 一道python难题3
    • ¥15 牛顿斯科特系数表表示
    • ¥15 arduino 步进电机
    • ¥20 程序进入HardFault_Handler
    • ¥15 关于#python#的问题:自动化测试