It drives me crazy. I am trying to execute a command line operator in a windows window for my PHP web application. It works on Windows XP, IIS5.1. The web application is working fine, but I cannot get @exec () to work with a specific contact variable. My command construct looks like this:
$cmd = ($config->svn." cat ".$this->repConfig->svnParams().quote($path).' -r '.$rev.' > '.quote($filename));
This command does not work as indicated above when it generates the following line:
svn --non-interactive --config-dir /tmp cat "file:///c:/temp/test/acccount/dbo_sproctest.sql" -r 1 > "C:\Inetpub\sites\websvn\temp\wsv5B45.tmp"
If I copy / paste this into my own command line, it works fine.
If I hardcode the same path rather than adding it with a variable, it works! I tried with and without quotes around the file name. I tried without quotes throughout the team. I tried other directories. I tried passing the output parameter to exec () and it returns empty (Array ()). I tried to redirect the output of the command error stream to a file, and this error output file is never created.
The only thing I can understand is that exec () fails. What am I doing wrong here? If I hardcode the file path using the same structure and file name, it works fine. If I do not, it is not.
It is possible that slashes () in the file path are not escaped properly, but when I do this manually with single quotes, they are not considered escape sequences
UPDATE:
I took @off exec and still see no errors.
SVN, . , SVN , cat.
2: RE: Kieth
exec, :
exec($cmd);
exec($cmd, $out);
php.ini safe_mode = 0.
error_reporting (E_ALL);
( print_r) exec,
echo ( print_r) exec var, arr
3
escapeshellcmd, escapeshellarg ( ).
,
tempnam("temp", "wbsn");
, , , tempname, , , , , . , , .