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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥50 永磁型步进电机PID算法
    • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
    • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
    • ¥15 如何处理复杂数据表格的除法运算
    • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
    • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
    • ¥200 uniapp长期运行卡死问题解决
    • ¥15 latex怎么处理论文引理引用参考文献
    • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
    • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?