I am using Drupal 5.1 and PHP 5.0. I have my drupal temp directory within the drupal directory hierarchy. It is /srv/www/htdocs/drupal/temp, so the setting is simply temp. Similarly, the files setting is files for the directory /srv/www/htdocs/drupal/files. If I leave open_basedir unset I can create Image items, upload attachments, create imagefields, etc. If I set open_basedir to /srv/www/htdocs/drupal I can do none of these, but I don't get an error messages. No files are created in either files or temp.

If I try and access files outside the directory hierarchy using file_get_contents I do get an error message, so that indicates that error messages are generated when the system trips over open_basedir.

The similar open_basedir support issues I have seen have error messages displayed and/or have the temp directory as /temp or /tmp, so access it blocked by open_basedir.

This is proving to be a real show-stopper. I must have open_basedir-like restrictions in place, because the server will be supporting a load of students with admin access to their own sites. Without some restrictions they can use php code to read any files they want!

Any hints, suggestions, pointers, etc. will be gratefully received.

Thanks
Tony Addyman

Comments

tony_addyman’s picture

I have found the problem: in php5.ini upload_tmp_dir was not set, so it defaulted to the system directory, which was outside of the open_basedir hierarchy. I set it to the same directory as the site's temp and Images, imagefields and attachments all work again. :-)

Eur Ing A.M.Addyman
School of Computing, Science and Engineering
University of Salford
Salford
M5 4WT, United Kingdom

JezV’s picture

Thanks for posting the solution, it helped me resolve a similar issue. It is frustrating when threads end without posting an answer.

Jez

lias’s picture

and images not displaying. I did have to go into phpmyadmin and fix the paths so they matched my current server config but this was making me nuts. Thanks for sharing tony_addyman!