Bug #53162 [NEW]: Can't use localhost without mapping it in hosts
| From: | znarkus at gmail dot com | Date: | Tue, 26 Oct 2010 07:01:32 +0000 |
| Subject: | Bug #53162 [NEW]: Can't use localhost without mapping it in hosts | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-155521@lists.php.net to get a copy of this message | ||
From:
Operating system: Windows 7 x64
PHP version: 5.3.3
Package: *Database Functions
Bug Type: Bug
Bug description:Can't use localhost without mapping it in hosts
Description:
------------
I can't connect to "localhost", only to "127.0.0.1". My MySQL server works
fine
and I can connect to it otherwise. PHP 5.3.0 and 5.2.11 work.
Please see
http://stackoverflow.com/questions/4015253/php-5-3-3-mysql-connect-
doesnt-work-with-localhost for more details.
Test script:
---------------
mysql_connect('localhost', 'root', '');
new mysqli('localhost', 'root', '');
new PDO('mysql:dbname=db_name;host=localhost', 'root', '');
die('' . rand(0, 9999));
Expected result:
----------------
0-9999
Actual result:
--------------
Warning: mysql_connect() [function.mysql-connect]: [2002] A connection
attempt
failed because the connected party did not (trying to connect via
tcp://localhost:3306) in
Warning: mysql_connect() [function.mysql-connect]: A connection attempt
failed
because the connected party did not properly respond after a period of
time, or
established connection failed because connected host has failed to respond.
in
Fatal error: Maximum execution time of 30 seconds exceeded in
--
Edit bug report at http://bugs.php.net/bug.php?id=53162&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53162&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53162&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53162&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=53162&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53162&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=53162&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=53162&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=53162&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=53162&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=53162&r=support
Expected behavior: http://bugs.php.net/fix.php?id=53162&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=53162&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=53162&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=53162&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53162&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53162&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=53162&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=53162&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=53162&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=53162&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=53162&r=mysqlcfg