Edit report at https://pear.php.net/bugs/bug.php?id=19090&edit=1

ID: 19090
Updated by: mrook@php.net
Reported By: carcus88@gmail.com
Summary: exec() does not work with spaces in command line
-Status: Open
+Status: Duplicate
Type: Bug
Package: VersionControl_SVN
Operating System: Windows
Package Version: 0.4.0
PHP Version: 5.2.12
Roadmap Versions:
New Comment:

-Status: Open
+Status: Duplicate

Previous Comments:

[2012-06-11 10:56:22] alex_le

Seems duplicate of Bug #18130


[2011-11-30 05:26:22] carcus88

If you have spaces in your command line for svn.exe then exec() will not
work. In order for it to work the entire command should be double quoted
again. See the test script for a easy example.

Test script:
$cmd = '"C:\Program Files\CollabNet Subversion\svn.exe" status
--username user --password password "C:\Program Files\Apache Software

# Fail
# exec("$cmd 2>&1", $out, $ret_var);

# Success
exec("\"$cmd 2>&1\"", $out, $ret_var);

Expected result:
I expected the svn executable to be invoked, it was not.

Actual result:
If you comment out the exec() under # Fail you will see errors in $out
because exec() does not deal with quoted path unless the whole string is
quoted again.


Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouppear-bugs @
postedOct 24, '12 at 8:52p
activeOct 24, '12 at 8:52p

1 user in discussion

Mrook: 1 post



site design / logo © 2022 Grokbase