From: yubing at baixing dot com
Operating system: CentOS 6.3 & Mac OSX
PHP version: 5.4.7
Package: Built-in web server
Bug Type: Bug
Bug description:http request never end
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 bug report at https://bugs.php.net/bug.php?id=63143&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=63143&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=63143&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=63143&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63143&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63143&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63143&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63143&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63143&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63143&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63143&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=63143&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=63143&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63143&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63143&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63143&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63143&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63143&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63143&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63143&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63143&r=mysqlcfg