pls HELP: exec ('xcopy ...', $output) not working
Moderator: General Moderators
pls HELP: exec ('xcopy ...', $output) not working
ive tried everything. it doesnt work. if anyone's asking if is there an issue with the escaping backslashes. i did escape them. and used the string command on the command line and its working properly.
Re: pls HELP: exec ('xcopy ...', $output) not working
define working & not working & post the command. what the ....? we cant read your mind.
Re: pls HELP: exec ('xcopy ...', $output) not working
sorry, all shell commands passed thru the exec function work. except for the xcopy
here's the a sample code i used:
exec ('xcopy c:\\source e:\\dest /E', $out);
i am trying to copy all the files and folders on the 'source' and copy it to 'dest' but nothing happened.
its not an issue of passing the wrong string to the command parameter of the exec function coz i directly used it on the command line and it worked just i wanted it to.
it doesnt even return a value for $out.
is there something wrong with my installation of the php program?
im using PHP 5 by the way. if it matters.
here's the a sample code i used:
exec ('xcopy c:\\source e:\\dest /E', $out);
i am trying to copy all the files and folders on the 'source' and copy it to 'dest' but nothing happened.
its not an issue of passing the wrong string to the command parameter of the exec function coz i directly used it on the command line and it worked just i wanted it to.
it doesnt even return a value for $out.
is there something wrong with my installation of the php program?
im using PHP 5 by the way. if it matters.
Re: pls HELP: exec ('xcopy ...', $output) not working
Did you try the command on the shell? It has to return an $out value, post it here. It may be null, it may be an empty string, but in programming everything has a "value" (even if that value represents that it does not have a value)
Also possibly the error message is being send to console or /dev/null, try redirecting all your outputs http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html
Also possibly the error message is being send to console or /dev/null, try redirecting all your outputs http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html
Re: pls HELP: exec ('xcopy ...', $output) not working
Josh thanks for the reply!
$out should return an array containing elements who's values are line responses from the shell. but it only returns an empty array and nothing happens, no file transfered or folders copied on the destination.
Is it possible the had the wrong setup on my server which, make is restricts the xcopy command?
$out should return an array containing elements who's values are line responses from the shell. but it only returns an empty array and nothing happens, no file transfered or folders copied on the destination.
Is it possible the had the wrong setup on my server which, make is restricts the xcopy command?
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: pls HELP: exec ('xcopy ...', $output) not working
Moved to PHP-Code.
Re: pls HELP: exec ('xcopy ...', $output) not working
Why don't you try my suggestion of redirecting the stderr output to a file or somewhere other then console. Not saying it's right but don't you think its kind of cheeky to ask for help and not try out any suggestions, yet continue asking unrelated questions?