Very odd PHP error, any file name that starts with admin (admin.php/admintest.php)

Discussion in 'PHP' started by chernann, Nov 4, 2006.

  1. chernann

    chernann New Member

    I'm testing LSWS now with LSAPI built using PHP 4.4.4. Under Apache everything is fine and under most conditions Litespeed is ok also.

    However, one very odd problem that cropped up is session variables don't seem to work SPECIFICALLY for admin.php. I can have the exact same code in a file called newadmin.php and it works just fine:

    e.g

    PHP:
    session_start();
    echo 
    $_SESSION['adminlevel'];
    This should return the current adminlevel variable stored in the session BUT this exact same code works in newadmin.php but fails in admin.php and admintest.php.

    This also only fails in the root directory of the virtualhost. Subdirectories work fine. With version 4.4.4 as an Apache module running on Apache 1.337, the exact same configuration is fine. Could this be a problem with LSAPI?
  2. mistwang

    mistwang LiteSpeed Staff

    Looks like a cookie path problem.
  3. chernann

    chernann New Member

    The cookie path is set to /. The exact same settings (same php.ini being used) works ok for Apache and PHP4. Changing the file name from admin.php to newadmin.php and the script starts working in a directory where there are no .htaccess rewrite rules.
  4. mistwang

    mistwang LiteSpeed Staff

    Please try disabling .htaccess see if it is the cause. You can also dump phpinfo in your script to help identify the problem.
  5. felosi

    felosi New Member

    I am having a similar problem on some sites. You go to login admin areas then it opens up the main site index minus the images and such. Like this screenshot here

    http://nix101.com/admin.png

Share This Page