FAQ
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

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
postedOct 24, '12 at 8:52p
activeOct 24, '12 at 8:52p
posts1
users1
websitepear.php.net

1 user in discussion

Mrook: 1 post

People

Translate

site design / logo © 2022 Grokbase