apache migration php issues

Discussion in 'General' started by typist, Feb 28, 2007.

  1. typist

    typist New Member

    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);
  2. mistwang

    mistwang LiteSpeed Staff

    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.

  3. typist

    typist New Member

    thank you.

    I just realised

    _SERVER["whatever_variable"] will work.

Share This Page