Hi,

I have a working 4.7.3 drupal with an upload problem.

When i try to attach file to a node i get this:

* warning: move_uploaded_file() [function.move-uploaded-file]: open_basedir restriction in effect. File(/tmp/phpL9dQyt) is not within the allowed path(s): (/var/www/miscogas.it/web:/usr/share/php) in /var/www/miscogas.it/web/includes/file.inc on line 239.
* warning: move_uploaded_file(/tmp/phpL9dQyt) [function.move-uploaded-file]: failed to open stream: Operation not permitted in /var/www/miscogas.it/web/includes/file.inc on line 239.
* warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpL9dQyt' to 'tmp/tmp_i09xRc' in /var/www/miscogas.it/web/includes/file.inc on line 239.

I can't take off the open_basedir restriction in my host, so i've to patch drupal to make it work.
I've found this: http://drupal.org/node/5961, but the patch is for 4.6.x and wont work in 4.7.
If I can use another dir instead of /tmp(using one dir in path...) for temporary file I can solve the problem? How can I do that??

Thanks

Francesco

PS sorry for bad english.. ;)

Comments

smokingtrucks’s picture

Francesco,

Have you tried changing your temporary directory? (administer->settings->file system settings)

I believe the open base directory restriction is preventing you from moving files from the temporary directory (/tmp in your case). I would create a new temporary directory off your web root (which shouldn't be affected by the open base dir restriction), and tell drupal that's your new temporary directory.

Neal