$url="http://www.source.com/top";
$destination=fopen("/var/www/vhosts/domain.com/httpdocs/temp/" . date('m-d-Y'),"w");
echo "dest=$destination<br>";
echo "url=$url<br>";
$source=fopen($url,"r");
$maxsize=5000000000;
$length=0;
while (($a=fread($source,1024))&&($length<$maxsize))
{
$tmpfile=$tmpfile . $a;
$length=$length+1024;
}
fwrite($destination,$tmpfile);
fclose($source);
fclose($destination);
Above PHP source work like a charm on my shared hosting account. However, it fails to write files on my dedicated Linux Centos machine. In this Centos machine the source $url is able read ok but this line:
$destination=fopen("/var/www/vhosts/domain.com/httpdocs/temp/" . date('m-d-Y'),"w");
Fails to write the file in Linux box. I tried running running above code under linux root user (such as php file-name.php) and able to create the file however unable to read source file:
$destination=fopen("/var/www/vhosts/domain.com/httpdocs/temp/" . date('m-d-Y'),"w");
I am getting a 403 error. I am very confused with what is going on with this Linux Centos machine. Like i posted earlier in this Centos box i am having problem of Session variables return empty between submit of same page. Any help is appreciated.