LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > apache migration php issues

Reply
 
Thread Tools Display Modes
  #1  
Old 02-28-2007, 09:34 AM
typist typist is offline
New Member
 
Join Date: Feb 2007
Posts: 3
Default 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); 
Reply With Quote
  #2  
Old 02-28-2007, 09:46 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
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.

Reply With Quote
  #3  
Old 02-28-2007, 06:03 PM
typist typist is offline
New Member
 
Join Date: Feb 2007
Posts: 3
thank you.

I just realised

_SERVER["whatever_variable"] will work.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.