Hello there:
I recently tried to upgrade my site from 4.7.1 to 5.1 using Fantastico.
It affected the site in the same way as these two previous posts:
http://drupal.org/node/92607
http://www.rhinocerus.net/drupal-installation/help-me-please-0
I restored the original site and re-imported the backed-up database, but still have the following error:
warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/style.css) is not within the allowed path(s): (/home2/sside67/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home2/sside67/public_html/g41/includes/theme.inc on line 67.
The two previous posts were unanswered, but it looks as if this is quite a common problem.
Can anyone help?
Comments
Suffering a similar problem
I am experiencing the same error message, though for different reasons I think (http://drupal.org/node/125438) (http://drupal.org/node/125170). In addition to eliminating the error messages, I am trying to discover whether this error is related to the fact that my initial admin page has returned.
As of now I don't know the answer, but since I found your post I will let you know if I get an answer or figure it out myself. Would appreciate it if you would do the same for me.
Good luck!
My problem (partly) solved, but how?
okay, I promised I would report back on this, so here it goes. I eventually turned to my hosting company to ask about the php error. They give very good service, and though it took them a couple of tries it seems they did clear up the php error message.
But, although I asked them to tell me what the problem was and how it was solved, they did not do so. Not surprising, as they probably don't have time to explain what they are doing to every client. It doesn't make me think less of them as a hosting service. But unfortunately it means I am no wiser (or no less foolish) than before the problem began, and I can't do anything to tell others how they might solve their php error problems.
I find one of the things I really value about the resources and discussion at drupal.org is that, though it takes work on my part, I end up learning lots of useful information in the process of resolving system issues. Thanks to all who take part!
Now I still have to resolve the admin screen issue. Here goes...
Possible Fix and Explanation
I received this message on a new 5.1 install.
Fix
It seems going to /?q=admin/build/themes and choosing Default and Enable for a particular theme made it go away.
Explanation
The reason in my case was pretty straight forward. I opened up the theme.inc and went to line 67. There, the code
if (file_exists($stylesheet = dirname($themes[$theme]->filename) .'/style.css'))attempts to verify if the theme you have selected has a style.css in its theme folder. In this initial case, the Drupal variable
$themes[$theme]->filenamewas returning a blank string. So, PHP was executingif(file_exists('/style.css'). In PHP, this attempts to check the base directory of your UNIX/LINUX server for a file called style.css.This is where the
open_basedircomes into play. If you look at your Apache or PHP configuration then somewhere you'll see an entry for something likeopen_basedir "/home/username/public_html/:/usr/lib/php:/usr/local/lib/php:/tmp"The location of this code may vary. It could be in a directive in your httpd.conf ( varies by host, possibly located in /usr/local/apache/conf/httpd.conf ) Or, I think you could also specify in an Apache .htaccess file. It might even be set globally in your php.ini file (location varies based on your host, usually somewhere under /usr/local/).Anyway, the open_basedir is a security measure meant to restrict PHP executed by the Apache web server to particular folders and their sub folders. So, when the code
if(file_exists('/style.css')is executed PHP warns you that the /style.css is outside of the acceptable execution realm. Leave these settings alone, as you rarely need/want PHP to have access to more restricted system folders outside the public folders (like /home OR /public_html ) and PHP's include folders ( /usr/lib/php OR /usr/local/lib/php )After setting a default theme, as mentioned above, it checks the existence a relative path (notice no leading /) like themes/themename/style.css, which is in the range of acceptable paths described by the open_basedir.
OrangeCoat.com