Odd Limitations of Open_basedir

I am having a problem with move_uploaded_filein PHP, with an returned error message telling me that the open_basedir restriction is in place (which I set) and that the path I am trying to write is not in valid paths, but it (and is clearly displayed in the error message).

Has anyone come across this before?

Edit:

Sorry, error message may help !:

Unhandled error (/var/www/vhosts/(myhost)/libs/imanager.php, 226): 2, '... move_uploaded_file () [function.move-uploaded-file]: open_basedir. The file (/ var / www / virtual domains /(MyHost)/httpdocs/tributes/images/precrop/1317227884228.jpg) is not within the valid path (s): (/ var / www / virtual domains / (myhost) / httpdocs / tributes / images / precrop /: / TMP) ...

+1
source share
3 answers

You will not meet this before. You can use move_uploaded_file if the file you are trying to move has been uploaded using PHP. Try removing the trailing '/' from your precrop directory in the configuration.

There is additional information from open_basedir here: http://www.bigsoft.co.uk/blog/index.php/2007/12/30/fixing-php-s-require-open_basedir-restri

0
source

PHP ( " (5.3.3-5.3.4) open_basedir " ), , open_basedir . open_basedir. ​​ PHP.

0

Note that open_basedirit will also fail if you have symbolic links along the way. From http://php.net/open_basedir :

All symbolic links are allowed, so this restriction with a symbolic link cannot be avoided.

Please check if it is a /var/www/vhosts/(yourhost)/httpdocs/tributes/images/precrop/real directory and not a symbol.

0
source

All Articles