|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60480 SERVER_ADDR should be present in server variables
Submitted: 2011-12-09 13:46 UTC Modified: 2011-12-10 15:55 UTC
Avg. Score:3.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: lolautruche at gmail dot com Assigned: laruence (profile)
Status: Wont fix Package: Built-in web server
PHP Version: 5.4.0RC3 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-12-09 13:46 UTC] lolautruche at gmail dot com

Currently, SERVER_ADDR is absent from server variables, so that it needs to be 
defined in a router script. IMHO this variable should be available out-of-the-

Thanks !


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-10 03:21 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: laruence
 [2011-12-10 03:21 UTC]
Please try using this snapshot:
For Windows:

I added SERVER_NAME yesterday,  since it is handy.  you can use that instead :)
 [2011-12-10 14:28 UTC] lolautruche at gmail dot com
-Status: Feedback +Status: Assigned
 [2011-12-10 14:28 UTC] lolautruche at gmail dot com
Thanks ! Works smoothly :).
However, I still need to do $_SERVER['SERVER_ADDR'] = 
gethostbyname($_SERVER['SERVER_NAME']) in order to get SERVER_ADDR, resulting 
some overhead in the router script.
 [2011-12-10 15:55 UTC]
okey, since there is no a handy value of that, won't fix now ~
 [2011-12-10 15:55 UTC]
-Status: Assigned +Status: Wont fix
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Oct 01 18:01:24 2023 UTC