|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76230 use function getenv('REMOTE_ADDR'), i get Internal Server Error
Submitted: 2018-04-17 16:10 UTC Modified: 2018-04-18 08:04 UTC
From: 875019860 at qq dot com Assigned:
Status: Closed Package: Apache related
PHP Version: 7.2.1 OS: win10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: 875019860 at qq dot com
New email:
PHP Version: OS:


 [2018-04-17 16:10 UTC] 875019860 at qq dot com
From manual page:

$test = getenv('REMOTE_ADDR');

Test script:
$test = getenv('REMOTE_ADDR');
// i run this, get 500

Expected result:
Internal Server Error


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-04-17 16:19 UTC] spam2 at rhsoft dot net
"i get 500 but expected result Internal Server Error" makes no sense because it#s the same and i fail to see why do you expect that

a internal server error is typically the response when a fatl error occurs

either you have a syntax error somewhere and your test-script is not the whole code you run in reality or you have to look in errorlogs of webserver - maybe php don't work at all

however that bugreport is completly wrong 

BTW: getenv('REMOTE_ADDR'); 

ther is $_SERVER['REMOTE_ADDR'] which is way cheaper than a function call and it's not sure at all that you can get this on every system a env-var
 [2018-04-17 16:20 UTC]
-Status: Open +Status: Feedback
 [2018-04-17 16:20 UTC]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.

What does the error log say is the reason for the 500?
 [2018-04-18 08:04 UTC] 875019860 at qq dot com
-Status: Feedback +Status: Closed -PHP Version: 7.2.4 +PHP Version: 7.2.1
 [2018-04-18 08:04 UTC] 875019860 at qq dot com
see bug #75794
 [2018-04-18 08:42 UTC] spam2 at rhsoft dot net
i see and it clearly states "2018-01-15 Closing as the issue is confirmed fixed" while you report on 2018-04-17 for 7.2.1 and do not mention even that the server is crashing

would be so kind and in the future first update to the last bugfix release like 7.2.4 is now current and see if the problem is already fixed?
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 22 15:01:29 2024 UTC