Jump to content

Topic on Project:Support desk

[RESOLVED] Internal Error - PEAR mail package is not installed - Fixed in Localsettings.php

6
24.182.132.146 (talkcontribs)

I followed the help guide at http://pear.php.net/manual/en/installation.checking.php

pear list
Installed packages, channel pear.php.net:
=========================================
Package          Version State
Archive_Tar      1.3.11  stable
Auth_SASL        1.0.6   stable
Console_Getopt   1.3.1   stable
Mail             1.2.0   stable
Mail_Mime        1.8.9   stable
Net_SMTP         1.6.2   stable
Net_Socket       1.0.14  stable
PEAR             1.9.4   stable
Structures_Graph 1.0.4   stable
XML_Util         1.2.1   stable

check_pear.php comes back as true

Is it possible that my cli php/pear is installing somewhere different than where apache is looking? I don't use pear much so it's possible this is my issue somewhere.


Internal error PEAR mail package is not installed Backtrace:

  1. 0 /var/www/mediawiki/includes/User.php(3605): UserMailer::send(Object(MailAddress), Object(MailAddress), 'ACTSWiki email ...', 'Someone, probab...', NULL)
  2. 1 /var/www/mediawiki/includes/User.php(3583): User->sendMail('ACTSWiki email ...', 'Someone, probab...')
  3. 2 /var/www/mediawiki/includes/User.php(2182): User->sendConfirmationMail('changed')
  4. 3 /var/www/mediawiki/includes/specials/SpecialChangeEmail.php(240): User->setEmailWithConfirmation()
  5. 4 /var/www/mediawiki/includes/specials/SpecialChangeEmail.php(94): SpecialChangeEmail->attemptChange(Object(User), , )
  6. 5 /var/www/mediawiki/includes/SpecialPage.php(613): SpecialChangeEmail->execute(NULL)
  7. 6 /var/www/mediawiki/includes/SpecialPageFactory.php(487): SpecialPage->run(NULL)
  8. 7 /var/www/mediawiki/includes/Wiki.php(291): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
  9. 8 /var/www/mediawiki/includes/Wiki.php(565): MediaWiki->performRequest()
  10. 9 /var/www/mediawiki/includes/Wiki.php(458): MediaWiki->main()
  11. 10 /var/www/mediawiki/index.php(59): MediaWiki->run()
  12. 11 {main}
Ciencia Al Poder (talkcontribs)

Yes, usually PHP installs with different php.ini files, one for CLI and other for apache.

Follow the steps of that webpage you linked, specially when it talks about "To check PHP's include_path in your web server (...)"

Travs69 (talkcontribs)

I did that, unless I did it wrong. I put in above that check_pear.php comes back as true, which I thought means that it finds pear.

I know php has different files, but would pear be in more than once place? C

Can i be installing/checking pear from CLI and it really be somewhere different from the web interface? Everything I type shows pear at /usr/share/php

root@localhost:~#pear config-get php_dir /usr/share/php


check_php.php from the web shows include_path .:/usr/share/php

Is there anything for me to add to check_pear.php that would do the pear list to get an idea of what it is showing?

Thanks in advance!

Travs69 (talkcontribs)

Another update.. I added some code to the check pear script <?php require_once 'System.php'; require_once 'Mail.php'; var_dump(class_exists('System', false)); var_dump(class_exists('Mail', false)); ?>


When ran from the web browser it returns bool(true) bool(true)


So still poking around I found the ini_set part of LocalSettings.php and added my /usr/share/php directory to the include path there.. and that solved the issue. I'm still confused why adding it there was needed.

I should add that I inherited this setup and have no clue if this is standard in the LocalSettings.php or not $IP = "/var/www/mediawiki"; ini_set( "include_path", ".:$IP:$IP/includes:$IP/languages:/usr/share/php" );

Ciencia Al Poder (talkcontribs)

That's really odd. You said that check_php.php from the web shows include_path .:/usr/share/php, so adding it to ini_set in LocalSettings.php shouldn't be necessary, since it should be there already.

Maybe try a var_dump(ini_get('include_path')); in LocalSettings.php to see if it's really there

Travs69 (talkcontribs)

I think the problem is that check_pear.php uses the default include, my Localsettings.php had this: ini_set( "include_path", ".:$IP:$IP/includes:$IP/languages" ); which overwrites the include_path just for that php script.. so I would never see the wrong path in check_pear.php, and unless I had added those actual checks as part of Mediawiki somewhere (maybe in LocalSettings.php idk) to check it there. I'm not sure if that ini_set is standard in mediawiki (I only have one installation so know way to tell) but it looks like a better choice as of php 4.3.0 would be something like this (not tested!)

set_include_path(get_include_path() .":$IP:$IP/includes:$IP/languages");

which would add the path we want to the default include_path.


Just for tests I removed setting the ini_set part of LocalSettings.php and everything works as expected (so far) so I'm not even sure why that was in my LocalSettings.php.

Thanks for all the help

Reply to "[RESOLVED] Internal Error - PEAR mail package is not installed - Fixed in Localsettings.php"