note 29571 added to function.exec
| From: | kai dot wong at imperial dot ac dot uk | Date: | Tue, 18 Feb 2003 01:03:32 +0000 |
| Subject: | note 29571 added to function.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-44121@lists.php.net to get a copy of this message | ||
Please Help - Cannot get exec() executes commands under Windows
I am new to PHP and I am running my script on WinXP IIS/5.1 w/ PHP 4.2.x.
I have the following code and it does not work whatsoever:
<?
$command = "cmd /c xcopy I:\\Websites\\*.* \\\\some-pc\\wwwroot\\*.* /E /F /R /Y";
$rtn = exec($command);
echo $rtn;
//passthru($command); // tried this as well
?>
This script spends no time in execution and does not appear to do anything. I have tried to run the
xcopy command under the prompt, it went fine. But PHP does not seems to excute it. The $rtn and
pssthru() returns nothing!
I even have a copy of cmd.exe in the directory with the .php file.
Can anyone kindly lend me a hand and give me some hints please?
--
http://www.php.net/manual/en/function.exec.php
http://master.php.net/manage/user-notes.php?action=edit+29571
http://master.php.net/manage/user-notes.php?action=delete+29571
http://master.php.net/manage/user-notes.php?action=reject+29571