I've just moved a site via a git clone to my local dev server. Normally this works perfectly well but on restoring the database I get this lovely error:

[Mon May 06 13:54:21 2013] [error] [client] PHP Fatal error: require_once(): Failed opening required '/var/www/got//includes/plugins.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/got/sites/all/modules/ctools/ctools.module on line 113

As you can see, the URI is malformed: '/var/www/got//includes/plugins.inc'

I've tried playing around with htaccess as well as base_url and so on but nothing has helped so far. It's also at the point where I can't use drush to disable or enable plugins as it hits the same error. Additionally, I don't really want to go through deleting ctools and everything that depends on it; seems like a descent into madness.

I've checked out line 113 in the module itself and it's:
require_once DRUPAL_ROOT . '/' . drupal_get_path('module', $module) . "$dir$file.inc";

so I presume the hangup is with the module path but everything looks good.



merlinofchaos’s picture

As you say, that indicates that drupal_get_path() is failing.

I've never heard of drupal_get_path() failing. I don't even know how that can happen. I guess that would indicate something very wrong in your install; but if drupal_get_path() fails, I would think that entire modules would fail to work in dramatic ways.

AntiThesis’s picture

I'm going to go back and nuke the machine (vm) that's running this instance and make it identical to my live stuff. Then will see what the differences are.

Tracing through the steps where it all goes wrong, what's bizarre is that this error comes up the second time drupal tries to include plugin.inc. So before it hits the weird path error, it's already generated correct paths for many other inc files including plugin.inc

richard.c.allen2386’s picture

Any update on this issue? I'm experiencing the same issue, moving from dev to local and the same incorrect path.

richard.c.allen2386’s picture

I do think this may have to do with apache/php configuration, I was able to move this to other sites but can't seem to figure out the root of the problem. When I have a chance I'll head to my httpd.conf see if I can find anything out of the ordinary.

richard.c.allen2386’s picture

Loaded up MAMP to see if it was apache and I am still getting the same error message. I'm not sure what kind of bad configuration could persist through apache2 in osx and mamp. AFAIK MAMP contains it's own configs.