Open_Basedir Restriction In Effect

It seems that once in a while, you can’t help but meet some warning or error in your webpages especially as you get more and more adventurous as you progress in PHP or wordpress. Here’s one that I just got intimate with lately.

SHARE to your FRIENDS by CLICKING HERE:

Recently, a website I had just created and published for my boss had everything appear as I want it except for some additional text on the topmost part of the page. It says:


Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File( …text etc… < h1 >Title of Page..< / h1 > < div id='topimagebar' >…etc…< / div > …more text… in …/public_html/domainname/folder/filename.php on line 33.

This website is a 5-page information site and was created using Dreamweaver. It’s not a wordpress site. I used a template that I had also utilized for another website that had been published months ago. That website had worked perfectly and showed none of these warnings. I was thus baffled why this warning is showing up in this new website.

Inasmuch as solving warnings of this kind is not one of my fortes, I immediately dashed to google. (I remember someone in some forum answering the question of another poster with “YFGI”. It means “You f***ing google it!”) As always, google returned with a lot of pages, some useful, some useless.

One forum poster suggested that this is not an error but just a warning. (Hmmmnnn…very helpful suggestion. Yeah, it does say ‘Warning:‘). And that he’s pretty sure there’s got to be a reason why I’m seeing it. (Wow, even more helpful than the first answer). How can I be so naive as to not come up with these answers myself?

Well, there were a lot of other possible answers there, all of them having to do with tampering with files I’ve never heard of before. Ignorant as I am in matters like these, I chose to simply email my host for a solution and was promptly answered with the following:


You can turn off safe mode and open_basedir by making the following changes in your public_html folder:

  1. add to .htaccess :
    • suPHP_ConfigPath /home/username/public_html/
  2. add to php.ini (may need to create this file) and add to it:
    • safe_mode=Off
    • open_basedir=Off


Fortunately, when I looked at the directory mentioned, the .htaccess and php.ini files were there where they should be. Long story short, I downloaded, edited and re-uploaded the files. Now, this is the very first time I’ve ever even touched the tip of the tail of this .htaccess animal. So, after re-uploading it, I re-typed the url of the new website and closed my eyes while the browser churned, half expecting that when I open my eyes I’d see even more trouble. Fortunately, I was greeted with the heavenly site of a clean page without errors or warnings. Yes! I did it. I mean, one can actually create and publish webpages nowadays without knowing a thing about php or htaccesswatchawhatever as long as your host’s support have geniuses in their staff.

From what I’ve seen so far, I can see that what was done was to just repress the warnings. Like, simply repressing the symptoms but not really curing the disease. So, what was the cause of that warning? Beats me…

SHARE to your FRIENDS by CLICKING HERE:

6 thoughts on “Open_Basedir Restriction In Effect”

  1. I couldn’t agree more with you, a great support from your host works like magic. I’m not really that familiar with these kinds of web page development stuff but the least thing that I would touch on any file would be .htaccess. I’m a little scared to deal with some complex coding unless I’m sure.

    Kudos to you James!

    1. @Mathdelane: Yeah Math, that’s exactly how I feel with .htaccess files and php.ini files. My little experience with testing wordpress setups offline (using MoWeS portable) however had given me some degree of confidence with regard to the php.ini.

  2. I hate it when stuff like that happens to me. Like you I first turned to Google and that does not always help. Sooner or later I manage to resolve the problem and like you I always do a post, partly for my own benefit it case it ever happens again, but mostly to help others who may also come face to face with the same problem

    1. @Chandan: Of course buddy Chandan. Thank you for dropping by my humble blog. Hoping we could become blogger friends. I have added your blog in my list of favourite blogs to visit. 🙂

Comments are closed.