warning: getimagesize(): open_basedir restriction in effect. File(/tmp/phpvOwtQd) is not within the allowed path(s): (/home/site/public_html) in /home/public_html/site/modules/user.module on line 206.
warning: getimagesize(/tmp/phpvOwtQd): failed to open stream: Operation not permitted in /home/public_html/site/modules/user.module on line 206.
Hello all. I am going to attempt to post a SENSIBLE question... (re. some of my previous posts)
I have my drupal site served on a host which does not allow access to folders above the web root. This means that the url /tmp does not function at all. Which, I imagine, is why I'm receiving the above error.
I am trying to upload an image in a profile. Simple enough, but I can't for the life of me find the code which deals with it. Can anyone shed light on where I might be able to get access to the code? I've looked through the user.module file, and can't fathom where the file path for /tmp may be - i don't hink it's in here, although I may well be wrong.
The global temp path has been changed (in 'settings') to a writeable folder within the site structure, but this doesn't appear to have an impact. I'm lost! Any help gratefuly received.
thanks!
flea
Comments
PHP's temp dir
It could be that your installation of PHP is badly configured. PHP also needs a temporary directory for storing uploads while they are being uploaded. Check PHP's php.ini.
No acccess
Unfortunately I can't do that. I have no access to the php.ini file - that, along with all the main server control, resides with the host.
having checked out the phpinfo() on the server - I have found that 'upload_tmp_dir' has 'no value' - verification that there is no way to access a /tmp folder for php... i wonder howcome my other upload scripts work....
Have you tried using the exac
Have you tried using the exact path to the /tmp directory? I'm having the same issues you are, except my tmp folder is where it's supposed to be, has the correct permissions set and I can use other upload scripts to send files to it, but Drupal says it's either not there or it isn't writtable.
I digress. The code you're looking for is in file.inc
If you come up with a solution, post back here please.
Annie
/tmp path
Thakyou for your response, Annie.
I assume the line you're refering to in 'file.inc' is the following one:
define('FILE_DIRECTORY_TEMP', PHP_OS == 'WINNT' ? 'c:\\windows\\temp' : '/tmp');In which case I am afraid that I've already tried changing that to a completely writable folder and no luck.
Alas putting the exact path also seems to do nothing, and the error message doesn't even start to mention the pat I put in - it's getting '/tmp' from somewhere, and I just can't fathom where...
Versions
What does phpinfo() say about the settings of "safe_mode" and "open_basdir". What versions of apache,php,drupal are running?
http://www.php.net/features.safe-mode
settings
Settings as follows.
safe_mode = off
open_basedir = /home/site/public_html
Drupal 4.5rc - sorry should have specified that in original post
php 4.3.8
apache 1.3.29
Did you fix this?
If you did, please post solution. I am having exact same problem.