Bug #76230 [Fbk->Csd]: use function getenv('REMOTE_ADDR'), i get Internal Server Error
| From: | 875019860 at qq dot com | Date: | Wed, 18 Apr 2018 08:04:10 +0000 |
| Subject: | Bug #76230 [Fbk->Csd]: use function getenv('REMOTE_ADDR'), i get Internal Server Error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-214787@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
User updated by: 875019860 at qq dot com
Reported by: 875019860 at qq dot com
Summary: use function getenv('REMOTE_ADDR'), i get Internal
Server Error
-Status: Feedback
+Status: Closed
Type: Bug
Package: Apache related
Operating System: win10
-PHP Version: 7.2.4
+PHP Version: 7.2.1
Block user comment: N
Private report: N
New Comment:
see bug #75794
https://bugs.php.net/bug.php?id=75794
Previous Comments:
------------------------------------------------------------------------
[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