ポジローぽけっと

昨日より今日、今日より明日を信じて、トライトライ

phpのsystem関数が終わらなくなったら

標準出力を捨てたら動いた。。

現象

system関数の後続のロジックが動作しなかった

system("hogehoge -fugafuga");
// ロジックが続く

暫定対策

以下とすると動作した

system("hogehoge -fugafuga > /dev/null");
// ロジックが続く

下記が該当してるっぽいけど、 PHPがハングしたらthe program(php)は永遠に終わらないような気がするけどどうなってんだろう

何が起きてるのか分からん。。

Note: If a program is started with this function, in order for it to continue running in the background, the output of the program must be redirected to a file or another output stream. Failing to do so will cause PHP to hang until the execution of the program ends.

参考

PHP: system - Manual