Posted by eight17 on June 2, 2004 at 2:29pm
I am getting the following error in my new Drupal installation:
warning: init_theme(): Failed opening '' for inclusion (include_path='') in /path/to/drupal/includes/theme.inc on line 51.
... with, of course, a lack of any theme. I am using PHP v4.3.4 and MySQL 3.23.58 on Apache (unknown version; 1.?) through a host, so I can't edit php.ini myself. I did a search here in the forums and used the suggestion to delete all (two) entries in the variable table, but that made no difference.
Anyone have any ideas? Please help!
Comments
Did you upgrade from 4.3 to 4
Did you upgrade from 4.3 to 4.4 ? if so make sure that no old 4.3 themes are in your themes folder. Also, chose another default theme through direct database access.
--
Drupal services
My Drupal services
Sorry, I didn't mention that
Sorry, I didn't mention that I did a fresh install of Drupal 4.4 - no upgrade or anything - so all themes & database content present are those distributed with the code. Do I have to "choose" a default theme in the database or code somewhere? What gives?
No, it should including the d
No, it should including the default theme 'xtemplate'... but, it seems to be trying to include a blank string.
If you go into theme.inc and trace where init_theme() gets the string from (list_themes)... I could only guess that either the DB query is failing or the call to file_exists().
Hope that helps.
-Skip
include_path
seems to be empty in your error message. If you can't access php.ini, try setting the path in .htaccess:
php_value include_path .or look at setting it in common.inc:
ini_set("include_path", "." );The "." means the current directory, ie. where Drupal is installed. HTH :)
/marky
--
/marky
No Dice :(
Setting the
php_valuein .htaccess and addingini_set("include_path", "." );to common.inc did nothing but change the error towarning: init_theme(): Failed opening '' for inclusion (include_path='.') in /path/to/drupal/includes/theme.inc on line 51.(include path now contains a period instead of being empty.)
I put the values back in the
variabletable (I took them out as stated in previous post), and I verified that the "xtemplate" default theme file was indeed present. I know the database connection works, because I can e-mail myself a new password using my username. I think it must be the path to the theme that is breaking, but I don't know.Since the above fixes didn't work, does anyone have any other suggestions?
File ownership/permissions
I ran into this just now after upgrading from 4.4.0 to 4.4.2. I'd accidentally changed the file ownership when I copied the new files on - changing them back got rid of the problem.
I'd suggest checking file permissions and ownership.
HTH,
G.
Solution to init_theme(): Failed opening
Same thing happened to me. What was even weirder was that a Drupal installation in a different directory on the same server installed flawlessly and worked great! That was my clue. The bottom line here: the .htaccess file isn't working for some reason.
Here's how to verify that the problem is indeed the .htaccess file:
Pull a PHP status (using a test.php file with <?php phpinfo(); ?> in it), you can see if these local values are correct:
The first one is the crucial one. If it isn't "user", then it is probably 'files', and Drupal won't work. It'll produce this error:
Next, we have to determine the reason .htaccess isn't changing the session.save_handler parm to user. First, be sure the .htaccess file exists in the Drupal directory, and be sure it is the one that comes with Drupal. (It is easy to miss the .htaccess file in a file copy of the directory since it can take an extra command to copy it.) Next, be sure the priviledges on the .htaccess file allow apache to read it.
If it still doesn't work, then the "AllowOverride" statement in Apache's httpd.conf file isn't set right. This can be tricky, since you have to place an "AllowOverride All" statment for each of directory sets you will be using to serve web pages.
If you are usng the main Apache DocumentRoot directory to house your Drupal server, then it needs to have "AllowOverride All", as below. And this is pretty standard and easy to find. It'll look close to this:
The trick is that when serving web pages from directories other than Apache's DocumentRoot, you must configure a section for each directory set! Here is how Apache's httpd.conf file comes default in version 1.3.31 (note that it is commented out!):
You want to uncomment this section and modify it to end up looking something like this:
Add in any additional Limits and security you need, of course. Be sure the "/home/*/public_html/" part matches the directory structure where you have your Drupal installed.
Once I had made the changes in the httpd.conf file and restarted Apache, my new Drupal installation worked like a dream.
init_theme(): Failed opening problem
I have just tried a new install of Drupal 4.4.2 on my shared host and got the same error message:
warning: init_theme(): Failed opening '' for inclusion (include_path='') in /home/gswborg/public_html/drupal/includes/theme.inc on line 51.
Since I'm trying to install on a shared host I do not have access to Apache httpd.conf and am unable to apply the suggested solution.
Is there another solution to this problem?
warning: init_theme(): Failed opening '' for inclusion (include
If all the above doesn't fix the problem, there's one more thing to look at. The 'system' table must have a theme row that corresponds to the theme you're choosing. Mine didn't. It only had an entry for an old theme that's no longer in my themes folder because the instructions for upgrading to 4.4 say to remove all the 4.3 files. So, either:
1 - edit the system table and add the appropriate row, or
2 - save the theme you were using in 4.3 before erasing all the files, then move the saved theme back into the themes folder.