Help needed: is_dir() [function.is-dir]: open_basedir restriction in effect.

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by bastoubach on March 4, 2009 at 5:34pm

Hello,
I am still new-ish to Drupal.

I recently moved my site from local machine to a test online site. When I try to create content, I get this:

warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/Applications/MAMP/tmp/php) is not within the allowed path(s): (/var/www/vhosts/ermep.com/subdomains/test/httpdocs:/tmp) in /var/www/vhosts/ermep.com/subdomains/test/httpdocs/includes/file.inc on line 102.

I created the directory /var/www/vhosts/ermep.com/subdomains/test/httpdocs:/tmp/php and understand that I need to replace the old /Applications/MAMP/tmp/php with this new one. I tried to do that in the file systems (admin/settings/file-system) but it tells me The directory /var/www/vhosts/ermep.com/subdomains/test/httpdocs:/tmp/php does not exist. I cleared the cache, I opened the file.inc file and went to line 102, but it does not seem to be there either...

Can anybody help?

Thanks,

Sebastien.

Comments

Go to the admin panel and

Posted by drupalprojects on March 25, 2009 at 10:28pm

Go to the admin panel and edit filesystem settings.
I suggest you to put tmp folder inside files folder.

I frequently run into the

Posted by admixarts on February 7, 2010 at 5:36pm

I frequently run into the same sort of errors with the "/tmp" directory/file system when building Drupal sites. What I found is that there seems to be some confusion happening between who owns the /tmp directory (i'm talking about directory permissions). I'm mostly a designer not a full fledged developer so I appologize if I get the dev handshake talk screwed up. What I think is going on here is: If you let Drupal create your /tmp directory by using your File System settings in the admin area, it then assigns or attempts to assign the permissions to that directory. Those permissions seem to work very differently than if you were to create the /tmp directory on your own with an FTP client.

What I usually do to fix my /tmp directory problems is: Delete the auto generated /tmp dir using my FTP client or file manager from within Cpanel or other hosting control panel software. Then I just re-create a new directory, give it the same name as the one we deleted (/tmp), make sure it's properly writable and I'm off to the races. Well most of the time.

The file system in Drupal can act quite finicky at times in certain server environments. I found some servers I never have the issue on others happen on almost every site.

I'll start documenting this issue some more the next time it surfaces for me.

Another thing you can double

Posted by admixarts on February 7, 2010 at 6:00pm

Another thing you can double check is your .htaccess file settings.

If your root install is located in a sub directory you should modify the RewriteBase rule by un-commenting line #103 (in my file) (rule looks like: # RewriteBase /). Then add the path to your install directory like: RewriteBase /subdir-or-virtual-root/drupal-install-dir

no joy

Posted by staff_whyte on March 5, 2011 at 12:34pm

I tried both these and did not work.
I dont have a tmp folder in my sites/default/files folder either, I created one and still no joy...any ideas?
I am getting this after migrating from one host to another. The site is in a subdomain, I updated the .thaccess to rewritebase for /subdomain

fixed

Posted by staff_whyte on April 19, 2011 at 2:23pm

I updated the folder permissions to 777,also had wrong path to my tmp folder,contacted my hosting provider and got correct path.

folder permissions should never be 777!

Posted by triple5 on April 13, 2012 at 9:25am

don't do that.
777 means world writable, most likely you don't even want to have them world readable, let alone writable,
look at http://drupal.org/node/244924 for some detailed settings.

Open Basedir restrictions does not care about your file settings, when the path is not within allowed paths, you are just not allowing the file to be accessed, this is a setting in apache that may be overridden by the .htaccess file.

ning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/var/www/vhosts/vamarion.com/httpdocs/sites/all/files) is not within the allowed path(s): (/var/www/vhosts/mxel.net/httpdocs:/tmp) in file_directory_temp() (line 2354 of /var/www/vhosts/mxel.net/httpdocs/includes/file.inc).

I can't upload any images using field_image... I have tried all I know with permissions chmod/chown/chgrp etc. but no joy :(

It is a dedicated server at Godaddy

looking at paths

Posted by triple5 on April 13, 2012 at 9:26am

dotnhack: you have two different things set up, first you have a domain mxel.net and open basedir for that user does not allow the user vamarion.com to access the files. Did you set this up with ISPConfig or Plesk or something like that? It doesn't matter whatever you did, you probably have to set the path under
vamarion.com/admin/config/media/file-system
(in Drupal 7)
the directory should be owned by your user and the group be accessible to the server /for example www-data or in ISPconfig: client* and must probably be like this:
/var/www/vhosts/mxel.net/httpdocs/sites/all/files/tmp
it is not recommended to have the tmp dir readable by everybody!
file settings should be more like 770 than 777!
see also http://drupal.org/node/244924 for file permissions

AltStyle によって変換されたページ (->オリジナル) /