php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68415 "500 Internal Server Error" on connecting to non-existing host
Submitted: 2014-11-13 15:41 UTC Modified: 2014-11-14 07:46 UTC
Votes:5
Avg. Score:4.6 ± 0.5
Reproduced:5 of 5 (100.0%)
Same Version:5 (100.0%)
Same OS:4 (80.0%)
From: cmueller at jobrouter dot de Assigned: rasmus (profile)
Status: Closed Package: MySQLi related
PHP Version: 5.6.2 OS: Windows 7 SP1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cmueller at jobrouter dot de
New email:
PHP Version: OS:

 

 [2014-11-13 15:41 UTC] cmueller at jobrouter dot de
Description:
------------
If you connect to a non-existing host via mysqli_connect() or mysql_connect() you'll get an 500 Internal Server Error on Windows 7 SP1 with IIS 7.5 and PHP 5.6.2.

With PHP 5.4.32 an error message is shown.

Test script:
---------------
$conn = mysqli_connect(
    'xxxxxxxxxxx',
    'test',
    'test'
);

Expected result:
----------------
Show an error message that cannot connect to host.

Actual result:
--------------
500 Internal Server Error

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-13 15:45 UTC] cmueller at jobrouter dot de
The output from the Windows event log:
Name der fehlerhaften Anwendung: php-cgi.exe, Version: 5.6.2.0, Zeitstempel: 0x543eed4a
Name des fehlerhaften Moduls: KERNELBASE.dll, Version: 6.1.7601.18409, Zeitstempel: 0x53159a86
Ausnahmecode: 0xc0000005
Fehleroffset: 0x0000c42d
ID des fehlerhaften Prozesses: 0x2cac
Startzeit der fehlerhaften Anwendung: 0x01cfff48611dc1bb
Pfad der fehlerhaften Anwendung: C:\Program Files (x86)\PHP 5.6\php-cgi.exe
Pfad des fehlerhaften Moduls: C:\Windows\syswow64\KERNELBASE.dll
Berichtskennung: e8d8d143-6b3c-11e4-9b9a-ecf4bb35880a
 [2014-11-13 17:40 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2014-11-13 17:40 UTC] ab@php.net
That's what i see running your snippet:

Warning: mysqli_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known.  in Command line code on line 1

Warning: mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: No such host is known.  in Command line code on line 1

Could you please retry with the debug symbols? Maybe some backtrace can be seen in the event log then, or even it could produce a dump. Or use the DebugDiag, it can do it as well.

Thanks
 [2014-11-14 07:33 UTC] brack at jobrouter dot de
With PHP 5.6.3 the problem is no longer reproducible (Windows 8.1).
 [2014-11-14 07:46 UTC] rasmus@php.net
-Status: Feedback +Status: Closed -Assigned To: +Assigned To: rasmus
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC