Page 1 of 1

using Exec() or shell_exec() to run sys cmds not working

Posted: Tue Jul 16, 2002 8:32 am
by eatrom
example code:

<?

$command = "mv myfile.txt archive/";
$output = shell_exec("$command");
echo(nl2br($output));

?>

results in an error stating
Warning: Cannot execute using backquotes in safe mode in /home/.../test.php on line 4

Does this mean that the server is protected from executing system commands from PHP? I've tried with and without back ticks and get the same response.

What I need is to (eventually) have a php cron job that ftp's a file off another server and then processes it. But if I can't use php to exec the ftp command, and do simple things like cp and mv, then it is going to get tiring having to do these by hand each day.

:roll:

Any help??