php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53382 'localhost' not resolved
Submitted: 2010-11-23 04:20 UTC Modified: 2010-11-23 05:22 UTC
From: geoffreyfishing at users dot sourceforge dot net Assigned:
Status: Duplicate Package: Network related
PHP Version: 5.3.3 OS: vista (maybe win7)
Private report: No CVE-ID: None
 [2010-11-23 04:20 UTC] geoffreyfishing at users dot sourceforge dot net
Description:
------------
Basically PHP does not convert the DNS name 'localhost' to '127.0.0.1' like it 
should.

Test script:
---------------
<?php
//THIS WON'T REPRODUCE IF YOU DON'T RUN IT ON VISTA

echo gethostbyname('localhost');

//Basically applies to any other PHP function that resolves 'localhost'
echo mysql_connect('localhost', 'root', '');

?>

Expected result:
----------------
127.0.0.1
[some link identifier]

Actual result:
--------------
localhost
false

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-23 04:46 UTC] cataphract@php.net
I can't reproduce the gethostbyname problem in Vista. I get '127.0.0.1'.

As to your mysql problems, please try 5.3.4RC1, which you can download from http://windows.php.net/qa/ . If that solves the mysql problem, then it's likely bug #50953.
 [2010-11-23 04:46 UTC] cataphract@php.net
-Status: Open +Status: Feedback
 [2010-11-23 04:50 UTC] geoffreyfishing at users dot sourceforge dot net
-Status: Feedback +Status: Closed
 [2010-11-23 04:50 UTC] geoffreyfishing at users dot sourceforge dot net
Duplicate
 [2010-11-23 05:22 UTC] cataphract@php.net
-Status: Closed +Status: Duplicate
 [2010-11-23 05:22 UTC] cataphract@php.net
Then mark it as such.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 18:01:30 2024 UTC