apache migration php issues

#1
is there a php alternative to
PHP:
apache_request_headers()
[ formerly getallheaders() ]
or will I need to use JS workarounds?

also, my php error messager script below no longer seems to return appropriate errors (only "unknown").
I know I've seen this done with litespeed...can anyone point me in the right direction?

PHP:
$error = $_SERVER['REDIRECT_STATUS'];
$referring_url = $_SERVER['HTTP_REFERER'];
$requested_url = $_SERVER['REQUEST_URI'];
$referring_ip = $_SERVER['REMOTE_ADDR'];
$server_name = $_SERVER['SERVER_NAME'];

switch ($error) {
case 400:
$errorname = 'Error 400 - Bad Request';
$errordesc = '<h4>Bad Request - Error 400</h4>
<p>Your request was not understood.</p>';
# 401, 404 etc details omitted here...
default:
$errorname = 'Unknown Error';
$errordesc = '<h4>Unknown Error</h4>
<p>The URL you requested resulted in an unknown error.</p>';
break; }
echo($errordesc);
 

mistwang

LiteSpeed Staff
#2
apache_request_headers() only works when PHP run as an Apache module.
'REDIRECT_STATUS' variable is Apache specific, not a standard CGI environment variable, so it is not available in LSWS yet, we will add it in 3.0 official release.

 
Top