mediawiki密码重置无法发送电子邮件,创建用户无法工作


mediawiki password reset not sending email and create user not working

当我点击重置密码时,我得到以下错误

[b5009e59] /kb/index.php/Special:PasswordReset Exception from line 304 of /opt/html/kb/includes/UserMailer.php: PEAR mail package is not installed
Backtrace:
#0 /opt/html/kb/includes/User.php(3885): UserMailer::send(MailAddress, MailAddress, string, string, NULL)
#1 /opt/html/kb/includes/specials/SpecialPasswordReset.php(281): User->sendMail(string, string)
#2 [internal function]: SpecialPasswordReset->onSubmit(array, HTMLForm)
#3 /opt/html/kb/includes/htmlform/HTMLForm.php(470): call_user_func(array, array, HTMLForm)
#4 /opt/html/kb/includes/htmlform/HTMLForm.php(412): HTMLForm->trySubmit()
#5 /opt/html/kb/includes/htmlform/HTMLForm.php(427): HTMLForm->tryAuthorizedSubmit()
#6 /opt/html/kb/includes/specialpage/FormSpecialPage.php(142): HTMLForm->show()
#7 /opt/html/kb/includes/specialpage/SpecialPage.php(379): FormSpecialPage->execute(NULL)
#8 /opt/html/kb/includes/specialpage/SpecialPageFactory.php(503): SpecialPage->run(NULL)
#9 /opt/html/kb/includes/Wiki.php(285): SpecialPageFactory::executePath(Title, RequestContext)
#10 /opt/html/kb/includes/Wiki.php(588): MediaWiki->performRequest()
#11 /opt/html/kb/includes/Wiki.php(447): MediaWiki->main()
#12 /opt/html/kb/index.php(46): MediaWiki->run()
#13 {main}

我已经安装了所有模块

pear list
Installed packages, channel pear.php.net:
=========================================
Package          Version State
Archive_Tar      1.3.13  stable
Auth_SASL        1.0.6   stable
Cache_Lite       1.7.16  stable
Console_Getopt   1.3.1   stable
DB               1.7.14  stable
HTTP_Request2    2.2.1   stable
Log              1.12.8  stable
MDB2             2.4.1   stable
Mail             1.2.0   stable
Net_SMTP         1.6.2   stable
Net_Socket       1.0.14  stable
Net_URL2         2.0.9   stable
PEAR             1.9.5   stable
Structures_Graph 1.0.4   stable
XML_RPC          1.5.5   stable
XML_RPC2         1.1.2   stable
XML_Util         1.2.3   stable

我已经重新启动了apache,并且也包含在include-path 中

 php -c /etc/php.ini -r 'echo get_include_path()."'n";'
.:/php/includes:/usr/share/pear

我试过在谷歌上搜索这个问题,但没有找到任何解决方案。

尝试创建用户时的堆栈争用

 [7f3f1adc] /kb/index.php?title=Special:UserLogin&action=submitlogin&type=signup Exception from line 304 of /opt/html/kb/includes/UserMailer.php: PEAR mail package is not installed
Backtrace:
#0 /opt/html/kb/includes/User.php(3885): UserMailer::send(MailAddress, MailAddress, string, string, NULL)
#1 /opt/html/kb/includes/specials/SpecialUserlogin.php(983): User->sendMail(string, string)
#2 /opt/html/kb/includes/specials/SpecialUserlogin.php(258): LoginForm->mailPasswordInternal(User, boolean, string, string)
#3 /opt/html/kb/includes/specials/SpecialUserlogin.php(223): LoginForm->addNewAccountMailPassword()
#4 /opt/html/kb/includes/specialpage/SpecialPage.php(379): LoginForm->execute(NULL)
#5 /opt/html/kb/includes/specialpage/SpecialPageFactory.php(503): SpecialPage->run(NULL)
#6 /opt/html/kb/includes/Wiki.php(285): SpecialPageFactory::executePath(Title, RequestContext)
#7 /opt/html/kb/includes/Wiki.php(588): MediaWiki->performRequest()
#8 /opt/html/kb/includes/Wiki.php(447): MediaWiki->main()
#9 /opt/html/kb/index.php(46): MediaWiki->run()
#10 {main}

调试

 [caches] main: MemcachedPhpBagOStuff, message: MemcachedPhpBagOStuff, parser: MemcachedPhpBagOStuff
[caches] LocalisationCache: using store LCStoreDB
Fully initialised
User: got user 17 from cache
Connected to database 0 at localhost
User: loading options for user 17 from override cache.
User: logged in from session
User: loading options for user 17 from override cache.
MessageCache::load: Loading en... got from global cache
Unstubbing $wgParser on call of $wgParser::firstCallInit from MessageCache::getParser
Parser: using preprocessor: Preprocessor_DOM
Unstubbing $wgLang on call of $wgLang::_unstub from ParserOptions::__construct
User::getBlockedStatus: checking...
IP: 172.16.0.85
MWCryptRand::realGenerate: Generating cryptographic random bytes for User::setToken/MWCryptRand::generateHex/MWCryptRand::realGenerateHex/MWCryptRand::generate/MWCryptRand::realGenerate
MWCryptRand::realGenerate: openssl_random_pseudo_bytes generated 16 bytes of strong randomness.
MWCryptRand::realGenerate: 0 bytes of randomness leftover in the buffer.
DatabaseBase::query: Writes done: INSERT IGNORE INTO `user` (user_id,user_name,user_password,user_newpassword,user_newpass_time,user_email,user_email_authenticated,user_real_name,user_token,user_registration,user_editcount,user_touched) VALUES (NULL,'Heshamfs','','',NULL,'heshamfs@spectrum-geopex.com.eg',NULL,'Hesham Sokkar','fbe6039d3d8721e290bad06e14708e86','20150521134628','0','20150521134633')
User: loading options for user 31 from database.
MWCryptRand::realGenerate: Generating cryptographic random bytes for User::setToken/MWCryptRand::generateHex/MWCryptRand::realGenerateHex/MWCryptRand::generate/MWCryptRand::realGenerate
MWCryptRand::realGenerate: openssl_random_pseudo_bytes generated 16 bytes of strong randomness.
MWCryptRand::realGenerate: 0 bytes of randomness leftover in the buffer.
MWCryptRand::realGenerate: Generating cryptographic random bytes for User::setToken/MWCryptRand::generateHex/MWCryptRand::realGenerateHex/MWCryptRand::generate/MWCryptRand::realGenerate
MWCryptRand::realGenerate: openssl_random_pseudo_bytes generated 16 bytes of strong randomness.
MWCryptRand::realGenerate: 0 bytes of randomness leftover in the buffer.
MWCryptRand::realGenerate: Generating cryptographic random bytes for User::setToken/MWCryptRand::generateHex/MWCryptRand::realGenerateHex/MWCryptRand::generate/MWCryptRand::realGenerate
MWCryptRand::realGenerate: openssl_random_pseudo_bytes generated 16 bytes of strong randomness.
MWCryptRand::realGenerate: 0 bytes of randomness leftover in the buffer.
MWCryptRand::realGenerate: Generating cryptographic random bytes for User::randomPassword/MWCryptRand::generateHex/MWCryptRand::realGenerateHex/MWCryptRand::generate/MWCryptRand::realGenerate
MWCryptRand::realGenerate: openssl_random_pseudo_bytes generated 7 bytes of strong randomness.
MWCryptRand::realGenerate: 0 bytes of randomness leftover in the buffer.
MWCryptRand::realGenerate: Generating cryptographic random bytes for User::crypt/MWCryptRand::generateHex/MWCryptRand::realGenerateHex/MWCryptRand::generate/MWCryptRand::realGenerate
MWCryptRand::realGenerate: openssl_random_pseudo_bytes generated 4 bytes of strong randomness.
MWCryptRand::realGenerate: 0 bytes of randomness leftover in the buffer.
UserMailer::send: sending mail to Heshamfs <heshamfs@spectrum-geopex.com.eg>
[Bug56269] Exception thrown with an uncommited database transaction: [7f3f1adc] /kb/index.php?title=Special:UserLogin&action=submitlogin&type=signup Exception from line 304 of /opt/html/kb/includes/UserMailer.php: PEAR mail package is not installed
#0 /opt/html/kb/includes/User.php(3885): UserMailer::send(Object(MailAddress), Object(MailAddress), 'Account creatio...', 'Someone created...', NULL)
#1 /opt/html/kb/includes/specials/SpecialUserlogin.php(983): User->sendMail('Account creatio...', 'Someone created...')
#2 /opt/html/kb/includes/specials/SpecialUserlogin.php(258): LoginForm->mailPasswordInternal(Object(User), false, 'createaccount-t...', 'createaccount-t...')
#3 /opt/html/kb/includes/specials/SpecialUserlogin.php(223): LoginForm->addNewAccountMailPassword()
#4 /opt/html/kb/includes/specialpage/SpecialPage.php(379): LoginForm->execute(NULL)
#5 /opt/html/kb/includes/specialpage/SpecialPageFactory.php(503): SpecialPage->run(NULL)
#6 /opt/html/kb/includes/Wiki.php(285): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#7 /opt/html/kb/includes/Wiki.php(588): MediaWiki->performRequest()
#8 /opt/html/kb/includes/Wiki.php(447): MediaWiki->main()
#9 /opt/html/kb/index.php(46): MediaWiki->run()
#10 {main}
[exception] [7f3f1adc] /kb/index.php?title=Special:UserLogin&action=submitlogin&type=signup Exception from line 304 of /opt/html/kb/includes/UserMailer.php: PEAR mail package is not installed
#0 /opt/html/kb/includes/User.php(3885): UserMailer::send(Object(MailAddress), Object(MailAddress), 'Account creatio...', 'Someone created...', NULL)
#1 /opt/html/kb/includes/specials/SpecialUserlogin.php(983): User->sendMail('Account creatio...', 'Someone created...')
#2 /opt/html/kb/includes/specials/SpecialUserlogin.php(258): LoginForm->mailPasswordInternal(Object(User), false, 'createaccount-t...', 'createaccount-t...')
#3 /opt/html/kb/includes/specials/SpecialUserlogin.php(223): LoginForm->addNewAccountMailPassword()
#4 /opt/html/kb/includes/specialpage/SpecialPage.php(379): LoginForm->execute(NULL)
#5 /opt/html/kb/includes/specialpage/SpecialPageFactory.php(503): SpecialPage->run(NULL)
#6 /opt/html/kb/includes/Wiki.php(285): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#7 /opt/html/kb/includes/Wiki.php(588): MediaWiki->performRequest()
#8 /opt/html/kb/includes/Wiki.php(447): MediaWiki->main()
#9 /opt/html/kb/index.php(46): MediaWiki->run()
#10 {main} 

LocalSettings.php中,包含路径设置不正确。

set_include_path( implode( PATH_SEPARATOR, $path ) );

将其更改为

set_include_path( get_include_path() . ":" .implode( PATH_SEPARATOR, $path ) );

检查您的pear模块是否真的安装在/usr/share/pear中。错误消息意味着php找不到Mail包,因此路径似乎为false。您可以在控制台中运行以下命令:

pear config-get php_dir

并将生成的路径添加到php.ini中的include_path变量中,而不是实际的路径。

您在php.ini上设置了包含路径吗?

类似这样的东西:

include_path = ".;/path/to/php/pear"

(如果存在,请验证php.ini中是否没有注释这一行)