Bug #76230 [Com]: use function getenv('REMOTE_ADDR'), i get Internal Server Error
| From: | spam2 at rhsoft dot net | Date: | Wed, 18 Apr 2018 08:42:41 +0000 |
| Subject: | Bug #76230 [Com]: use function getenv('REMOTE_ADDR'), i get Internal Server Error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-214789@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76230&edit=1
ID: 76230
Comment by: spam2 at rhsoft dot net
Reported by: 875019860 at qq dot com
Summary: use function getenv('REMOTE_ADDR'), i get Internal
Server Error
Status: Closed
Type: Bug
Package: Apache related
Operating System: win10
PHP Version: 7.2.1
Block user comment: N
Private report: N
New Comment:
i see https://bugs.php.net/bug.php?id=75794 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?
Previous Comments:
------------------------------------------------------------------------
[2018-04-18 08:04:07] 875019860 at qq dot com
see bug #75794
https://bugs.php.net/bug.php?id=75794
------------------------------------------------------------------------
[2018-04-17 16:20:34] requinix@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
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-17 16:19:01] 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
http://php.net/manual/en/function.error-reporting.php
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');
why?
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:10:53] 875019860 at qq dot com
Description:
------------
---
From manual page: http://www.php.net/function.getenv
---
$test = getenv('REMOTE_ADDR');
var_dump($test);
Test script:
---------------
<?php
$test = getenv('REMOTE_ADDR');
var_dump($test);
// i run this, get 500
Expected result:
----------------
Internal Server Error
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76230&edit=1