|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8248 system function cannot support "&"
Submitted: 2000-12-14 03:50 UTC Modified: 2001-04-28 09:30 UTC
From: erwinba at 163 dot net Assigned:
Status: Closed Package: Program Execution
PHP Version: 4.0.3 OS: Linux
Private report: No CVE-ID: None
 [2000-12-14 03:50 UTC] erwinba at 163 dot net
the "system", "exec" or "passthru" function cannot support
the background process, such as :
system("/mycommand/myprog &");

The functions will not continue untill "/mycommand/myprog"
is finished, but I wish the PHP can return at once to continue after the myprog is started not ended.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-01 15:21 UTC]
Have you tried disabling safe_mode?  The command will not be stripped of "questionable" characters if safe_mode is disabled.

 [2001-04-28 09:30 UTC]
This is not a bug.  From the manual (

"Note also that if you start a program using this function and want to leave it running in the background, you have to make sure that the output of that program is redirected to a file or some other output stream or else PHP will hang until the execution of the program ends."

Try changing your code from:

system("/mycommand/myprog &");


system("/mycommand/myprog > /dev/null &");

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 01 12:01:29 2024 UTC