Open_Basedir Restriction In Effect
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:
- add to .htaccess :
- suPHP_ConfigPath /home/username/public_html/
- add to php.ini (may need to create this file) and add to it:
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…
Filed under: Website
Like this post? Subscribe to my RSS feed and get loads more!