开发者

Problem with exec in PHP

开发者 https://www.devze.com 2023-02-18 06:21 出处:网络
I am running through a weird problem with exec\'s in PHP. When I load in the browser the script x.php, the browser hangs and when I run a ps I can see multiple threads being created. The only way to s

I am running through a weird problem with exec's in PHP. When I load in the browser the script x.php, the browser hangs and when I run a ps I can see multiple threads being created. The only way to stop them is by resta开发者_C百科rting apache.

However, instead of running a php script, if I do something like system('ls'), it works fine. So it seems to be problem when a PHP script tries to run another script using exec/system/passthru (I've tried them all).

x.php is defined as following:

<?php
var_dump(system('php -f t.php'));
?>

t.php is defined as following:

<?php
echo 'Hello world';
?>


Take a look at first comment in exec() manual.

0

精彩评论

暂无评论...
验证码 换一张
取 消