Uploading Files Trouble
Posted: Tue Nov 04, 2003 8:43 pm
Ok, this is one of the wierdest things I've ever experienced with PHP. I was given free hosting by someone who I helped make a PHP script for. He needed an uploading script so I worked on it, tested it out on my domain and it worked. Then I gave it to him and now it gives this wierd error.
Warning: move_uploaded_file(): open_basedir restriction in effect. File(/submissions/installsubmissions.zip) is not within the allowed path(s): (/home/rctdload:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/rctdload/public_html/submissions.php on line 95
Now, I looked into open_basedir and basically what it does is restrict PHP from opening any files above a certain directory. This is one of safe_mode's options. It works whether safe_mode is on or not, so thats not the problem.
The wierdest thing is that both he and I are under the same account so we have exactly the same PHP.ini and are using the exact same PHP Script.
Heres the code near Line 95:
Does anyone have any ideas?
Warning: move_uploaded_file(): open_basedir restriction in effect. File(/submissions/installsubmissions.zip) is not within the allowed path(s): (/home/rctdload:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/rctdload/public_html/submissions.php on line 95
Now, I looked into open_basedir and basically what it does is restrict PHP from opening any files above a certain directory. This is one of safe_mode's options. It works whether safe_mode is on or not, so thats not the problem.
The wierdest thing is that both he and I are under the same account so we have exactly the same PHP.ini and are using the exact same PHP Script.
Heres the code near Line 95:
Code: Select all
<?php
$uploaddir = "/submissions/";
$filename=$_FILES['userfile']['name'];
$filetemp=$_FILES['userfile']['tmp_name'];
$dirfile = $uploaddir;
$dirfile .= $fileoriginalname;
//...
if (is_uploaded_file($filetemp)){
if (move_uploaded_file($filetemp,$dirfile)) //LINE 95
{
//... removed irrelevant code
?>