Search code examples
phpmysqlmediawikimamp

MediaWiki on MAMP, OSX 10.8.5: Unknown error in PHP's mail() function


I maintain a Mediawiki website, and until recently, everything was running fine. Users could login, create pages, register email address, etc.

But when one of my user tried to make a new account, she never receive the email confirmation from the server, but there never was any error message. Previously, users would receive something from 'apache@myurl.org' with the link and everything. I dabbled with the issue, and tried switching to another email address, going through the preference menu. However, after entering the new email address, the page showed the following error message, in bright red:

Error sending mail: Unknown error in PHP's mail() function."

I tried to create a test user, and after creating the account, I got this slightly different message (the email was a simple gmail, no weird characters or anything):

wikiname could not send your confirmation mail. Please check your email address for invalid characters. Mailer returned: Unknown error in PHP's mail() function."

I googled the error, and found that this error appears when admins would set up a SMTP server, nothing related to what I have done. I couldn't find any other helpful info.

I made sure the mysql database is accessible by the wiki user and that the LocalSettings.php has the correct mysql login info.

The emails settings have not changed in LocalSettings.php (and have worked before):

$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO
$wgEmergencyContact = "apache@myurl.org";
$wgPasswordSender = "apache@myurl.org";

The only other thing I can think of is that I changed the Apache port a while ago, but other users have created accounts and successfully verified their email since then.

I am running MAMP on OSX 10.8.5, with:

  • MediaWiki 1.22.5

  • php 5.5.10

  • mysql 5.5.34


Solution

  • I just figured it out!

    For those who ran into the same problem, here is how I fixed it:

    • Open MAMP
    • Open the preference menu, select the PHP tab
    • In the Cache drop-down menu, select 'APC' (mine was 'off')
    • Click 'OK', then type in your admin password

    Now go back to the wiki and resend the confirmation email. I haven't tried the other cache options, but they might work too.