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

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

Seems duplicate of Bug #18130


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

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

Description:
------------
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:
---------------
<?php
$cmd = '"C:\Program Files\CollabNet Subversion\svn.exe" status
--username user --password password "C:\Program Files\Apache Software
Foundation\Apache2.2\htdocs\index.htm"';

# 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
Discussion Overview
grouppear-bugs @
categoriesphp
postedJun 11, '12 at 8:51a
activeJun 11, '12 at 8:51a
posts1
users1
websitepear.php.net

1 user in discussion

Opi: 1 post

People

Translate

site design / logo © 2022 Grokbase