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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: geoffreyfishing at users dot sourceforge dot net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Mon Dec 30 14:01:28 2024 UTC