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

前端 未结 7 1048
迷失自我
迷失自我 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:40

    Try system and/or passthru. I've had issues with exec before because it halts trying to fill the return array with data until the process has finished.

    These will both echo raw output so even if they work you may need to handle that with a discarded output buffer.

提交回复
热议问题