|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38195 getmxrr broken in 5.1.4; worked in PHP 4.x
Submitted: 2006-07-24 16:36 UTC Modified: 2006-07-25 12:30 UTC
From: sam at ims dot net Assigned:
Status: Not a bug Package: *Network Functions
PHP Version: 5.1.4 OS: Fedora Core 4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: sam at ims dot net
New email:
PHP Version: OS:


 [2006-07-24 16:36 UTC] sam at ims dot net
After upgrading from PHP 4.4.1 to PHP 5.1.4, the getmxrr function ceased to work.  It does not throw an error message, but simply terminates the HTTP response at the call.  I've switched to checkdnsrr, which works fine, and is probably a more appropriate call, but since getmxrr is still in the documentation for version 5, this appears to be a bug.

Reproduce code:
if (getmxrr($host, $email)) return TRUE;

Expected result:
TRUE returned if $email corresponds to a domain with an MX record; FALSE otherwise.

Actual result:
Termination of HTTP response.  Neither TRUE nor FALSE returned.  Nothing appears in the Apache error log.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-24 17:02 UTC]
Works perfectly fine here:

# php -r 'var_dump(getmxrr("", $var)); var_dump($var);'
array(4) {
  string(18) ""
  string(18) ""
  string(18) ""
  string(18) ""

 [2006-07-24 18:12 UTC] sam at ims dot net
Doesn't work here (FC 4 machine), but checkdnsrr does:

sam@snoopy:~> php -r 'var_dump(getmxrr("", $var)); var_dump($var);'
sam@snoopy:~> php -r 'var_dump(checkdnsrr(""));'
sam@snoopy:~> uname -a
Linux snoopy 2.6.15-1.1830_FC4smp #1 SMP Thu Feb 2 17:39:38 EST 2006 i686 i686 i386 GNU/Linux

All works here (FC 5 machine):

sam@lassie:~> php -r 'var_dump(getmxrr("", $var)); var_dump($var);'
array(4) {
  string(18) ""
  string(18) ""
  string(18) ""
  string(18) ""
sam@lassie:~> uname -a
Linux lassie 2.6.17-1.2157_FC5 #1 Tue Jul 11 22:55:46 EDT 2006 i686 athlon i386 GNU/Linux
 [2006-07-25 06:58 UTC]
Obviously something is wrong on your FC4 machine and nobody except you can find out what exactly is broken there.
 [2006-07-25 12:30 UTC] sam at ims dot net
Yeah, I guess you're right - even though getmxrr worked perfectly fine just before I compiled and upgraded PHP 5.1.4.  Must be a problem with my machine that PHP 5.1.4 exposed.  I guess that's not a bug, although it certainly cost me in web app failure until I found out that it was a PHP call that had worked on that server fine for 5 years and suddenly was broken with a new PHP version.  But, ya know, I think I'll tell my clients that were very upset about it that it's a PHP bug, anyway, because I sure didn't change anything else on the server!
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Aug 15 08:01:26 2020 UTC