PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
mad_phpq
Forum Commoner
Posts: 85 Joined: Fri Apr 27, 2007 5:53 am
Post
by mad_phpq » Fri Nov 21, 2008 10:34 am
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!
VladSun
DevNet Master
Posts: 4313 Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria
Post
by VladSun » Fri Nov 21, 2008 10:41 am
Try
Code: Select all
echo exec("cp -a $dir/* $dir/testfolder 2>&1");
There are 10 types of people in this world, those who understand binary and those who don't
mad_phpq
Forum Commoner
Posts: 85 Joined: Fri Apr 27, 2007 5:53 am
Post
by mad_phpq » Fri Nov 21, 2008 10:43 am
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.
VladSun
DevNet Master
Posts: 4313 Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria
Post
by VladSun » Fri Nov 21, 2008 10:47 am
There are 10 types of people in this world, those who understand binary and those who don't
mad_phpq
Forum Commoner
Posts: 85 Joined: Fri Apr 27, 2007 5:53 am
Post
by mad_phpq » Fri Nov 21, 2008 10:48 am
the command works inside ssh, but not through php.
VladSun
DevNet Master
Posts: 4313 Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria
Post
by VladSun » Fri Nov 21, 2008 11:43 am
There are 10 types of people in this world, those who understand binary and those who don't