After installing mailmime 6.x-1.1 my testing site is unresponsive. The Apache error log states: "PHP Fatal error: require_once(): Failed opening required 'Mail/mime.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/mysite/sites/all/modules/mailmime/mailmime.inc on line 24". I needed to remove mailmime module from the file system in order to have this site back. The installation of mailmime was required by htmlmail upgrade, from 6.x-1.7 to 6.x-2.3.

Comments

pillarsdotnet’s picture

Title: Hosting provider does not support PEAR modules or the set_include_path command. » PHP disable_functions() list includes 'set_include_path'
Version: 6.x-1.4 » 6.x-1.2
Assigned: pillarsdotnet » Unassigned
Status: Needs work » Active

Apparently your Apache configuration is not letting PHP scripts change the include_path.

Possible fixes:

  • Edit your php.ini file and remove set_include_path from the disable_functions directive.

  • Manually add /var/www/mysite/sites/MYSITE/files/PEAR to your include_path, where /var/www/mysite/sites/MYSITE/ is the path to your site settings directory. You should able to do this in your .htaccess file, using the php_value directive.

  • Manually install Mail_Mime and its prerequisites. (This requires command-line root access).

    pear install --onlyreqdeps Mail_Mime Mail_mimeDecode PEAR
    
  • Ask me nicely and I might package up a customized version of the PEAR libraries. I wouldn't be able to host it on drupal.org, though.

pillarsdotnet’s picture

Title: PHP Fatal error freezes site » PHP disable_functions() list includes 'set_include_path'
Version: 6.x-1.1 » 6.x-1.2
Assigned: Unassigned » pillarsdotnet
Status: Active » Postponed (maintainer needs more info)
pillarsdotnet’s picture

Title: PHP disable_functions() list includes 'set_include_path' » PHP disable_functions directive prevents set_include_path from working.
pillarsdotnet’s picture

Version: 6.x-1.2 » 6.x-1.3
Status: Postponed (maintainer needs more info) » Fixed

The 6.x-1.3/7.x-1.3 release now provides better error logic in hook_requirements(), and will warn if a file was downloaded but could not be read because the set_include_path() function is disabled.

pillarsdotnet’s picture

Version: 6.x-1.3 » 6.x-1.4

Version bump. 6.x-1.3 had a syntax error, sigh.

jddeli’s picture

I dont have php.ini in my site.
How to remove set_include_path from the disable_functions directive?
How then i can use this module with HTML Mail?

pillarsdotnet’s picture

@jddell -- dunno; I suggested four ways to solve the problem. If you don't know how to do any of the four, then ask your hosting provider. That's why you pay them money -- so they will support you. Also see #1119088: Make dependencies optional

esbon’s picture

Hi I need to use this module, but it is changing the site's include_path to the files directory thus breaking all other includes. I read your four recommendations, but what I would need is for this module not change the include_path. Is there anything else I can do besides your recommendations above?

Thanks

pillarsdotnet’s picture

  1. PEAR modules won't work if they're not on the include_path. If you already have the requisite modules installed and they're already on the path, then you may simply delete both the mailmime.install and mailmime.module files.
  2. Adding a new directory to the include_path shouldn't be "breaking all other includes." If it is, then something is very wrong with your configuration, and you should contact your hosting provider to get it fixed.
pillarsdotnet’s picture

Title: PHP disable_functions directive prevents set_include_path from working. » Hosting provider does not support PEAR modules or the set_include_path command.
esbon’s picture

Thanks so much for your reply. Our php.ini is set to: .: I don’t know why that could be wrong, but this module is changing the site’s local include_path to: files/PEAR:.:
My whereis pear result is: /usr/share/pear
So what might work for us could be to disable the include function or change its path to /usr/share/pear I appreciate your help.

esbon’s picture

I also deleted the mailmine.install and mail.module, but this disabled the HTML module

pillarsdotnet’s picture

Recreate mailmime.module as an empty file.

pillarsdotnet’s picture

Status: Fixed » Needs work
esbon’s picture

I did recreate mailmime.module as an empty file, but the the whole site goes white and I can get this error:

Fatal error: require_once() [function.require]: Failed opening required 'Mail/mime.php' (include_path='.:') in /sites/default/modules/mailmime/mailmime.inc on line 24

thanks

pillarsdotnet’s picture

Then you don't have the required PEAR module installed. Either install it or ask your hosting provider to do so.

esbon’s picture

Since pear was installed and working, I ran: pear install Mail_Mime to install Mail_Mime and it is now working with an empty mailmime.module file

Thanks for your help!

pillarsdotnet’s picture

I will try to code the "Mail Mime" module so that it properly detects this kind of situation, disables itself, and displays a message instructing the user to manually install the pear package.

jddeli’s picture

My hosting provider dont understand what you are write
Apparently your Apache configuration is not letting PHP scripts change the include_path.

Possible fixes:

•Edit your php.ini file and remove set_include_path from the disable_functions directive.

•Manually add /var/www/mysite/sites/MYSITE/files/PEAR to your include_path, where /var/www/mysite/sites/MYSITE/ is the path to your site settings directory. You shoud able to do this in your .htaccess file, using the php_value directive.

•Manually install Mail_Mime and its prerequisites. (This requires command-line root access).

pear install --onlyreqdeps Mail_Mime Mail_mimeDecode PEAR

•Ask me nicely and I might package up a customized version of the PEAR libraries. I wouldn't be able to host it on drupal.org, though.

esbon’s picture

Title: PHP disable_functions() list includes 'set_include_path' » Hosting provider does not support PEAR modules or the set_include_path command.
Version: 6.x-1.2 » 6.x-1.4
Assigned: Unassigned » pillarsdotnet
Status: Active » Needs work

In reply to #18, I think this will make things a lot easier. Thanks very much for the time and effort to get this working.

pillarsdotnet’s picture

Writing (yet another!) module to handle this. It will most likely become a dependency of the next version of Mail MIME, which will in turn become much smaller.

EDIT: The new module will be called Include.

jddeli’s picture

I cant work html mail with Mail MIME there is not a guide to put pear in my site.
I have apatch php php my admin.
I want to use this module but there is not a guide how i can but pear in my site and what to i have to enter in pear

jddeli’s picture

Make the effort to but same guides

pillarsdotnet’s picture

Status: Needs work » Needs review

Fixed in the 7.x-2.0 release. Will roll a 6.x-2.0 release shortly.

pillarsdotnet’s picture

Version: 6.x-1.4 » 6.x-2.0

Release 6.x-2.0 version which should fix this problem nicely. Anyone care to test?

pillarsdotnet’s picture

Version: 6.x-2.0 » 6.x-2.x-dev
Status: Needs review » Fixed

Extensively tested and fixed all errors I can find. The 2.x branch is now default, recommended, and supported. Let the complaining begin!

pillarsdotnet’s picture

Okay, 6.x-2.3 and 7.x-2.x no longer have a hard dependency on the Include module.

The new startup code looks something like this:

  1. If everything loaded okay the last time, SUCCESS.
  2. Try to load the required files. If all the classes are present, SUCCESS.
  3. If Include is enabled, and it can auto-download the dependencies, SUCCESS.
  4. Otherwise:
    • Disable Mail MIME
    • Write a big fat warning to both screen and watchdog
    • FAILURE

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Quarath’s picture

Manually add /var/www/mysite/sites/MYSITE/files/PEAR to your include_path, where /var/www/mysite/sites/MYSITE/ is the path to your site settings directory. You should able to do this in your .htaccess file, using the php_value directive.

Don't have access to any other solution - please could you elaborate how to do this? What exacly to add to .htaccess?