LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   General (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=25)
-   -   apache migration php issues (http://www.litespeedtech.com/support/forum/showthread.php?t=898)

typist 02-28-2007 09:34 AM

apache migration php issues
 
is there a php alternative to
PHP Code:

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 Code:

$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 02-28-2007 09:46 AM

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.


typist 02-28-2007 06:03 PM

thank you.

I just realised

_SERVER["whatever_variable"] will work.


All times are GMT -7. The time now is 04:09 AM.