A server's just upgraded from PHP version 4.1.2 to PHP version 4.4.2.
My file uploading script is now throwing the following error:
(I've replaced the actual server path with MY SERVER PATH)
Warning: move_uploaded_file(): open_basedir restriction in effect.
File(/MY SERVER PATH /testpdf2.pdf) is not within the allowed path(s): (/MY SERVER PATH/httpdocs:/tmp) in /MY SERVER PATH/uploader.php on line 95
The bit of my script is:
/* In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead of $_FILES. */
$uploaddir = '/*MY SERVER PATH*/pdf/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
/* move_uploaded_file(string filename, string destination) */
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile))
{
echo "File is valid, and was successfully uploaded.";
}
else {
echo "Failed";
}
Line 95 is the beginning of the 'if' statement - ie:
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile))
I originally got this script from zend:
http://www.zend.com/manual/features.file-upload.php
Anyone got a clue what's busted?