PHP: exec() doesn't run in the background even with “>/dev/null 2>&1 &”

前端 未结 7 1049
迷失自我
迷失自我 2021-01-04 10:59

I\'m calling this in my php script:

    exec(\"gutschein.php >/dev/null 2>&1 &\");

Calling the script (generates a pdf and s

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-04 11:55

    All output must be redirected, else the script will hang as long as gutschein.php executes. Try

    exec('/usr/bin/php gutschein.php &> /dev/null &');
    

提交回复
热议问题