ID:               32888
 Updated by:       [EMAIL PROTECTED]
 Reported By:      kaufmann at brainworxx dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         Program Execution
 Operating System: Windows XP
 PHP Version:      4.3.11
 New Comment:

It's an windows issue, see the user comments at:
http://www.php.net/exec



Previous Comments:
------------------------------------------------------------------------

[2005-04-29 10:34:15] kaufmann at brainworxx dot de

Description:
------------
Hello,

I am using Apache with latest php 4 release (also tried latest php4
cvs). I am having problems executing external programs using exec,
system and also using proc_open.

While trying to execute using exec or system, the script just hangs off
(but does not hook up the apache process).
Commands that are enabled in command.com (like dir) are working fine!

Using proc_open I encountered another problem. Executing at all works.
Executing a script from command-line works, but calling the same script
from url using apache doesn't (returns no result).
I figured out, that the default path for the programs is the
apache-path, which seems to enforce this problem.

I was unable to change the path using the cwd-option refered to on
php.net documentation. In this case the proc_open also just returns
nothing.

Another problem I figured out was, that get_stream_contets hooks the
script (even if it is working with fgets instead).


Reproduce code:
---------------
<?
pipe_spec = array(
                  0 => array("pipe", "r"),
                  1 => array("pipe", "w"),                                2 => 
array("file",
"ziperrors.txt", "a")
                 );

// using proc_open
$process = proc_open('zip', $pipe_spec, $pipes,'c:\');
// for some reason get_stream_contents also hangs anyway!
while (!feof($pipes[1])) // read results
  { print fgets($pipes[1]); }
fclose($pipes[1]);
proc_close($process);


// using system / exec (same results with both of them)

exec('dir'); // works fine
exec('zip'); // script hangs / deadload
print `zip`; // using backticks causes also deadload
?>

Expected result:
----------------
I expect to get any result / execute of the programs executed

Actual result:
--------------
actual results are...

1) exec or system call causes hookup / deadload of script
2.a) proc_open works, but wrong execution path, unable to change
exec_path using proc_open cwd-option
2.b) get_stream_contents also deadloads, needed to be replaced with
fgets to get nearly any result at all.


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


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

Reply via email to