PDA

View Full Version : shell_exec - unix commands in PHP


stryka
02-02-2007, 09:37 PM
Ok... here's the scenario...

I am using the fileuploadcenter hack and i want to create a custom task that will copy the uploaded file into another folder....

eg) cp filename /destination/path/


right now i have defined a new scheduled task that points to a PHP that does the following:


$files = $vbulletin->db->query_read("
SELECT *
FROM " . TABLE_PREFIX . "ftpfolder
");

while ($file = $vbulletin->db->fetch_array($files))
{

$file_name = $file[file_name];
$options = "$file_name" . " /destinationpath/";

$command .="cp $options";
shell_exec($command); //system call



the syntax looks fine... but nothing happens...... any ideas

Dismounted
02-03-2007, 01:22 AM
shell_exec is probably disabled on your server for security reasons.

stryka
02-03-2007, 03:02 PM
Is there any other safe way?