php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24759 exec() or system() et all cause an infinite loop of starting requested program
Submitted: 2003-07-22 18:42 UTC Modified: 2003-07-23 09:52 UTC
From: jkramer at controlvision dot com Assigned:
Status: Not a bug Package: IIS related
PHP Version: 4.3.2 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jkramer at controlvision dot com
New email:
PHP Version: OS:

 

 [2003-07-22 18:42 UTC] jkramer at controlvision dot com
Description:
------------
In a PHP script running under IIS 5.1, with Windows XP (this has been reproduced on Windows 2000 as well), I try to execute another PHP process and get as many php sessions as can open up till my machine starts to halt because it goes out of memory.  

Note, I have made sure it hits that line of code only once, by doing "cmd /c Start C:\php\php.exe -f phpfile.php" and doing an echo "before"; and echo "after"; before and after the line of code, before and after get echoed ONCE.  

This command works correctly via the commandline.

Reproduce code:
---------------
<?PHP
  exec('c:\php\php.exe -f C:\inetpub\wwwroot\anotherphpfile.php');
?>



Expected result:
----------------
The application to run once.. not 50-100 or more times..



Actual result:
--------------
PHP executes numerous times, for one line of code..

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-23 00:58 UTC] wez@php.net
You are running the CGI version of PHP and it picks up the script name from the environment now, rather than from the command line as it is "more secure".

There is (or should be) an ini setting to control this, however, you probably want to be running the CLI version of PHP from your scripts instead.

 [2003-07-23 02:28 UTC] edink@php.net
Use cli (c:\php\cli\php.exe) if you want to start a php command line processor.
 [2003-07-23 09:52 UTC] jkramer at controlvision dot com
I have found the CLI version of PHP and this does not happen in the CLI version.  Thanks for the input..  you should make some type of warning about running via the command line when using the CGI version.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 07:01:32 2024 UTC