The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can anyone help with authentification page problem?

Discussion in 'General Discussion' started by sportsminded, Mar 25, 2006.

  1. sportsminded

    sportsminded Registered

    Joined:
    Mar 25, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi, I've had some programming done in PHP and everything has worked fine for like two years on CPanel reseller hosting sites, but all of a sudden the programs stopped working. I moved to another CPanel host and that corrected every problem accept for one. I'm trying to get into my admin section which pulls data from php myadmin in report formats but the password I've always used all of a sudden isn't working. I haven't changed anything either. The index page code is as follows:
    <?php
    if (!isset($PHP_AUTH_USER)) {
    // If empty, send header causing dialog box to appear
    header('WWW-Authenticate: Basic realm="phpMyAdmin"');
    header('HTTP/1.0 401 Unauthorized');
    echo 'Authorization Required.';
    exit;
    } else if (isset($PHP_AUTH_USER)) {
    if (($PHP_AUTH_USER != "admin") || ($PHP_AUTH_PW != "example")) {
    header('WWW-Authenticate: Basic realm="My Private Stuff"');
    header('HTTP/1.0 401 Unauthorized');
    echo 'Authorization Required.';
    exit;
    }
    }

    Does anyone know what might the problem be?

    Thanks.
     
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    $PHP_AUTH_USER and $PHP_AUTH_PW won't work if the server has phpsuexec enabled.

    Or I should say that they generally won't or aren't supposed to work, although there are some workarounds.

    Hence it's quite likely that your host has phpsuexec enabled. You'd need to check and, if so, try and find a workaround and see if you host can help implement it.

    Searching the forums will find you some workarounds.
     
  3. sportsminded

    sportsminded Registered

    Joined:
    Mar 25, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for your help Webignition

    I'll check with the new host to see if they have phpsuexec and see if I can find some workarounds.

    Thanks!
     
Loading...

Share This Page