An error "open_basedir restriction in effect"
<p>I am building a website that has image uploading. </p>

<p>This is the part that is responsible of image uploading:</p>

<pre><code>$ip=rand();
$filename1 = "/public_html/friendscave/temporary/".$ip;
$filename2 = "/public_html/friendscave/temporary/".rand();
$filename3 = "/public_html/friendscave/temporary/".rand();
$filename4 = "/public_html/friendscave/temporary/".rand();
copy($pictures1, $filename1);
copy($pictures2, $filename2);
copy($pictures3, $filename3);
copy($pictures4, $filename4);
$fp1 = fopen($filename1, 'r');
$contents1 = fread($fp1, filesize($filename1)); 
$fp2 = fopen($filename2, "r");
$fp3 = fopen($filename3, "r");
$fp4 = fopen($filename4, "r");
$contents2 = fread($fp2, filesize($filename2)); 
$contents3 = fread($fp3, filesize($filename3)); 
$contents4 = fread($fp4, filesize($filename4));
fclose($fp1); 
fclose($fp2); 
fclose($fp3); 
fclose($fp4);  
$encoded1 = chunk_split(base64_encode($contents1));  
$encoded2 = chunk_split(base64_encode($contents2));  
$encoded3 = chunk_split(base64_encode($contents3));  
$encoded4 = chunk_split(base64_encode($contents4));  
</code></pre>

<p>This is the error that I got</p>

<pre><code>Warning: copy() [function.copy]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/:/usr/lib/php:/tmp) in /PostAD.php on line 130
</code></pre>

<p>I didn't understand this error.
Can someone help me please?</p>
