"Fatal error: main() [function.require]: Failed opening required 'amazon.php5.inc' (include_path='.:/usr/share/pear') in /home/httpd/vhosts/"domain".com/httpdocs/modules/amazontools/amazon.module on line 7"

I'm sorry if this isn't the right place, but I've only been using Drupal for about a week, and I installed this module and now the whole site is down. If I remove Amazon Associate Tools and reload the page, everything goes back to normal. I tried wiping the entire domain, deleting it, and recreating it, but that didn't help. The server has CURL enabled. I also tried putting the amazon.php5.inc module in /usr/share/pear but that didn't help either.

Any suggestions would be appreciated, and again I apologize if this isn't the right place for this post.

Thanks
Jason

Comments

Prometheus6’s picture

Off the top of my head, try moving the folder from

/home/httpd/vhosts/"domain".com/httpdocs/modules/amazontools/

to

/home/httpd/vhosts/"domain".com/httpdocs/sites/all/amazontools/

jasonmcd’s picture

Thanks for your help.

I tried your suggestion, and the module didn't show up. Then I moved it into a folder called modules as per the sites/all/ readme.txt and that resulted in the same error as before.

Prometheus6’s picture

Okay, sometimes I type too fast. sites/all/modules/amazontools/ is where it all goes.

At the very top of the module, right after the <?php tag change this

if (version_compare(phpversion(), '5', '<')) {
  require_once('amazon.php4.inc');
}
else {
  require_once('amazon.php5.inc');
}

to this

$include_dir = base_path() . drupal_get_path('module', 'amazon');
if (version_compare(phpversion(), '5', '<')) {
  require_once($include_dir . 'amazon.php4.inc');
}
else {
  require_once($include_dir . 'amazon.php5.inc');
}
Prometheus6’s picture

Assigned: Unassigned » Prometheus6
Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)