Page 1 of 1

move file from domain to subdomain

Posted: Wed Aug 24, 2011 4:49 pm
by cnapsys
Hey all,
can anyone give me any pointers on how can I move a file from the main domain to a subdomain.

I've tried copy() and it didn't work.
I thought it was just a folder permission thing but after setting the destination folder to chmod 777 it still didnt work.
error reporting is turned off so I can't see exactly what the error message is.

box is rehl with plesk

php code

Code: Select all

$path1 = "/var/www/vhosts/domain.com/httpdocs/new/test/test.jpg";
$path2 = "/var/www/vhosts/domain.com/subdomains/img/httpdocs/test/test.jpg";
if (!copy($path1, $path2)) {
echo "failed to copy the file...";
}
Any help is greatly appreciated

Re: move file from domain to subdomain

Posted: Wed Aug 24, 2011 6:44 pm
by greip
Try enabling error reporting in your script to see what the problem is. See comments here: http://php.net/manual/en/function.error-reporting.php

Re: move file from domain to subdomain

Posted: Wed Aug 24, 2011 7:52 pm
by cnapsys
it returns a 2047... no clue what that is... any ideas?

Re: move file from domain to subdomain

Posted: Thu Aug 25, 2011 12:54 am
by cnapsys
after further digging it seems to be an open_basedir restriction.
is there a way to get around this without having to disable open_basedir???