Edit report at https://bugs.php.net/bug.php?id=63143&edit=1

 ID:                 63143
 Updated by:         [email protected]
 Reported by:        yubing at baixing dot com
 Summary:            http request never end
 Status:             Open
 Type:               Bug
 Package:            Built-in web server
 Operating System:   CentOS 6.3 & Mac OSX
 PHP Version:        5.4.7
 Block user comment: N
 Private report:     N

 New Comment:

sorry, I didn't get your point,  you mean test2.php will never stop while host 
is 
built-in server?


Previous Comments:
------------------------------------------------------------------------
[2012-09-23 14:59:40] yubing at baixing dot com

Description:
------------
I try to use php built-in to run some shell command like: apachectl restart

But I find that, if i start a new process by using 
exec()/passthru()/shell_exec() funcion, the http request will never close until 
I kill the process started in php .

I‘ve already tried to append "> /dev/null 2>&1 &"  to the command (as 
test1.php below)
or but the command to a shell script (as test2.php and ping.sh below)

but the http request still not close before the process ends.

It's ok to run the same code under Apache or pure php cli.
So I think it should be a bug of the php built-in web server, hope someone can 
fix it~

Test script:
---------------
test1.php:
  <?php
    exec('ping -c 100 google.com > /dev/null 2>&1 &',$output, $code);
    var_dump($output,$code);
  ?>
--------------------------------------
test2.php:
  <?php
    exec('ping.sh',$output, $code);
    var_dump($output,$code);
  ?>
ping.sh:
  #!/bin/bash
  ping -c 100 google.com > /dev/null 2>&1 &



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63143&edit=1

Reply via email to