Page 1 of 1

exec("cp -a", $output, $error)

Posted: Fri Nov 21, 2008 10:34 am
by mad_phpq
Not working on my server.

I have given write permissions for www-data (apache user) in this folder ($dir) and it will not work.

Code: Select all

 
 
$dir = '/www/folder';
 
exec("cp -a $dir/* $dir/testfolder", $output, $error);
 
 
Thanks in advance!

Re: exec("cp -a", $output, $error)

Posted: Fri Nov 21, 2008 10:41 am
by VladSun
Try

Code: Select all

echo exec("cp -a $dir/* $dir/testfolder 2>&1");

Re: exec("cp -a", $output, $error)

Posted: Fri Nov 21, 2008 10:43 am
by mad_phpq

Code: Select all

cp: target `/www/dle_creator/testfolder' is not a directory
will not create the folder i take it.... can this be done.... I've had the same problem with mkdir() earlier today, with the same outcome.

Re: exec("cp -a", $output, $error)

Posted: Fri Nov 21, 2008 10:47 am
by VladSun

Re: exec("cp -a", $output, $error)

Posted: Fri Nov 21, 2008 10:48 am
by mad_phpq
the command works inside ssh, but not through php.

Re: exec("cp -a", $output, $error)

Posted: Fri Nov 21, 2008 11:43 am
by VladSun

Code: Select all

mkdir -p