ID:               41224
 Updated by:       [EMAIL PROTECTED]
 Reported By:      boen dot robot at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Program Execution
 Operating System: Windows XP Professional SP2
 PHP Version:      5CVS-2007-04-29 (snap)
 New Comment:

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.




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

[2007-04-29 13:13:04] boen dot robot at gmail dot com

Description:
------------
When executing a command with system(), exec(), passthru() or
shell_exec(), quotes in the program's path are not accepted and nothing
is returned (except error code 1). The same command with quotes around
the path works from the command line. Without quotes, the program only
works if there are no spaces in the paths, which is where the real
problem lies.

Reproduce code:
---------------
<?php
ini_set('display_errors','On');
ini_set('error_reporting',1);
print system('"D:\vasko\Software\XSLT2\saxonsa8-8n\bin\transform.exe"
-a "D:\htdocs\XML\_benchmark\reference.xml"',$status);
print $status;
?>
Returns 1 (because of the "print $status" - otherwise it's an empty
default HTML).

<?php
ini_set('display_errors','On');
ini_set('error_reporting',1);
print system('D:\vasko\Software\XSLT2\saxonsa8-8n\bin\transform.exe -a
"D:\htdocs\XML\_benchmark\reference.xml"',$status);
print $status;
?>
Returns the output of the program, and 0 after it. This particular case
works, but if the path had spaces, there would be no way to execute the
program... not withing PHP anyway (a bat file could be a solution, but
still...).

Expected result:
----------------
The program should run even if the path to it has quotes and it's
output should be then printed.

Actual result:
--------------
The first code, when executed results in an error, which wouldn't be
raised with the same command executed directly from the command line.


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


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

Reply via email to