Bug #76230 [Com]: use function getenv('REMOTE_ADDR'), i get Internal Server Error
| From: | spam2 at rhsoft dot net | Date: | Tue, 17 Apr 2018 16:19:04 +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-214781@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: Open
Type: Bug
Package: Apache related
Operating System: win10
PHP Version: 7.2.4
Block user comment: N
Private report: N
New Comment:
"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
Previous Comments:
------------------------------------------------------------------------
[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