Re: help with exec()...
| From: | Richard Lynch | Date: | Fri, 05 Oct 2001 20:10:47 +0000 |
| Subject: | Re: help with exec()... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70190@lists.php.net to get a copy of this message | ||
> $cmd="mysqldump ...... > somefile.sql";
>
> if( !fopen("somefile.sql","r") ) { print error message };
>
> $cmd is correct... I've copy-pasted it tons of times in the command shell
Were you the "nobody" user when you did that? It really doesn't count for
much if you weren't, cuz PHP runs as "nobody" -- or similar depending on
User directive in httpd.conf
Also, that user has a different environment than you -- So the $PATH
variable that might have mysqldump in it for you, isn't there for them.
> and it worked... created the 'somefile.sql' and all. But none of the
> functions (exec, system..) works. When I use system it outputs me some
> header for mysqldump and that's all...
What, if any, error output and errorcode did you get from the optional
variables to exec?
exec($cmd, $output, $errorcode);
echo implode("<BR>\n", $output);
echo "errorcode is $errorcode<BR>\n";
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm