Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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..

like image 537
rix Avatar asked Jun 03 '26 07:06

rix


1 Answers

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

like image 186
Joe Hyde Avatar answered Jun 06 '26 01:06

Joe Hyde



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!