rix
rix

Reputation: 10632

Fatal error: require_once() with module .install file, drupal 7

I get the following error after reinstalling my site on localhost.

Fatal error: require_once() [function.require]: Failed opening required '/Applications/XAMPP/xamppfiles/htdocs/sites/all/modules/custom/redirect/redirect.install'

The .install file DOES exist, and is below:

 1 <?php
 2 /**
 3  * @file
 4  * 
 5  */
 6 
 7 /**
 8  * Implementation of hook_install().
 9  */
 10 function redirect_install() {
 11 
 12 }
 13 
 14 /**
 15  * Implementation of hook_uninstall().
 16  */
 17 function redirect_uninstall() {
 18   variable_del('desktop_site_home');
 19   variable_del('mobile_site_home');
 20 }

The module has no require or include statements at all.

Does anyone have any idea whatsoever what might be going wrong here?

Thanks in advance..

Upvotes: 3

Views: 883

Answers (1)

Joe Hyde
Joe Hyde

Reputation: 1018

You have a permissions and/or a file ownership problem.

Fix them quickly. This is my technique:

cd to the module's dir and:

chmod 775 *.install

Optionally, ls -la and see if there is a dominant owner of the files inside the Drupal docroot. Say you have some files owned by www-data in the group www-data.

If so, that's probably the user that your web server is running as. So...

chown www-data:www-data [filename]

hope that helps

joe

Upvotes: 2

Related Questions