Apache 2.0 and PHP_AUTH_USER

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew Brett

    #1

    Apache 2.0 and PHP_AUTH_USER

    I'm trying to get PHP authentication (using the headers to request
    authentication, and then checking $_SERVER[PHP_AUTH_USER] and
    $_SERVER[PHP_AUTH_PW]) - however, no matter what I do, I can't seem to get
    it to work. The login request box pops up fine, but when I enter the correct
    details, it just pops back up again, and then again, before finally dumping
    me at the authentication failed page. I've tried looking at phpinfo(), and
    PHP_AUTH_USER and PHP_AUTH_PASSWD are definitely not being filled. Having
    browsed google, I came up with two possible answers:

    1. I'm already using basic HTTP authentication via apache, and so (for
    security reasons) PHP doesn't get passed the user and password.
    This isn't the case - authentication is definitely switched off, and
    AuthType doesn't occur anywhere in my apache config. I've tried switching
    authentication on, and this means that the REMOTE_USER field gets filled, as
    expected, but has no effect on PHP_AUTH_USER (also as expected).

    2. I'm using the CGI version of PHP, rather than the Apache module.
    I don't think this is the case, but phpinfo() reports the PHP server API as
    "Apache 2.0 Filter", rather than anything clearcut. Does this mean I'm using
    the module or not?

    For reference, I'm running:

    Mandrake 9.1
    Apache 2.0.47
    PHP 4.3.1

    Any suggestions would be gratefully appreciated - if you'd like the full
    output of my phpinfo(), or the exact script I'm using (although I've tried a
    number of PHP authentication test scripts without any difference in
    results), then let me know. Finally, if it turns out I'm not using a PHP
    module, how can I set apache up so that it does? (I've tried adding
    LoadModule lines to my http2.conf, which doesn't make any difference).

    Thanks.


  • Andy Hassall

    #2
    Re: Apache 2.0 and PHP_AUTH_USER

    On Wed, 24 Sep 2003 23:23:55 +0100, "Andrew Brett" <usenet@brettwe b.plus.com>
    wrote:
    [color=blue]
    >I'm trying to get PHP authentication (using the headers to request
    >authentication , and then checking $_SERVER[PHP_AUTH_USER] and
    >$_SERVER[PHP_AUTH_PW]) - however, no matter what I do, I can't seem to get
    >it to work. The login request box pops up fine, but when I enter the correct
    >details, it just pops back up again, and then again, before finally dumping
    >me at the authentication failed page. I've tried looking at phpinfo(), and
    >PHP_AUTH_USE R and PHP_AUTH_PASSWD are definitely not being filled. Having
    >browsed google, I came up with two possible answers:
    >
    >1. I'm already using basic HTTP authentication via apache, and so (for
    >security reasons) PHP doesn't get passed the user and password.
    >This isn't the case - authentication is definitely switched off, and
    >AuthType doesn't occur anywhere in my apache config. I've tried switching
    >authenticati on on, and this means that the REMOTE_USER field gets filled, as
    >expected, but has no effect on PHP_AUTH_USER (also as expected).
    >
    >2. I'm using the CGI version of PHP, rather than the Apache module.
    >I don't think this is the case, but phpinfo() reports the PHP server API as
    >"Apache 2.0 Filter", rather than anything clearcut. Does this mean I'm using
    >the module or not?[/color]

    You are using the module.
    [color=blue]
    >For reference, I'm running:
    >
    >Mandrake 9.1
    >Apache 2.0.47
    >PHP 4.3.1
    >
    >Any suggestions would be gratefully appreciated - if you'd like the full
    >output of my phpinfo(), or the exact script I'm using (although I've tried a
    >number of PHP authentication test scripts without any difference in
    >results), then let me know. Finally, if it turns out I'm not using a PHP
    >module, how can I set apache up so that it does? (I've tried adding
    >LoadModule lines to my http2.conf, which doesn't make any difference).[/color]

    This appears relevant:

    http://bugs.php.net/bug.php?id=2044 1

    Are you in safe mode?

    --
    Andy Hassall (andy@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk )
    Space: disk usage analysis tool (http://www.andyhsoftwa re.co.uk/space)

    Comment

    • Andrew Brett

      #3
      Re: Apache 2.0 and PHP_AUTH_USER

      Thanks for the suggestion. However, this report only covers cases where
      basic HTTP authentication (using .htaccess) is switched on. I've made sure
      it's switched off, but that makes no difference.

      "Andy Hassall" <andy@andyh.co. uk> wrote in message
      news:5794nv8ora 5sdt6vhgttbl9f4 m136jame1@4ax.c om...[color=blue]
      > On Wed, 24 Sep 2003 23:23:55 +0100, "Andrew Brett"[/color]
      <usenet@brettwe b.plus.com>[color=blue]
      > wrote:
      >[color=green]
      > >I'm trying to get PHP authentication (using the headers to request
      > >authentication , and then checking $_SERVER[PHP_AUTH_USER] and
      > >$_SERVER[PHP_AUTH_PW]) - however, no matter what I do, I can't seem to[/color][/color]
      get[color=blue][color=green]
      > >it to work. The login request box pops up fine, but when I enter the[/color][/color]
      correct[color=blue][color=green]
      > >details, it just pops back up again, and then again, before finally[/color][/color]
      dumping[color=blue][color=green]
      > >me at the authentication failed page. I've tried looking at phpinfo(),[/color][/color]
      and[color=blue][color=green]
      > >PHP_AUTH_USE R and PHP_AUTH_PASSWD are definitely not being filled. Having
      > >browsed google, I came up with two possible answers:
      > >
      > >1. I'm already using basic HTTP authentication via apache, and so (for
      > >security reasons) PHP doesn't get passed the user and password.
      > >This isn't the case - authentication is definitely switched off, and
      > >AuthType doesn't occur anywhere in my apache config. I've tried switching
      > >authenticati on on, and this means that the REMOTE_USER field gets filled,[/color][/color]
      as[color=blue][color=green]
      > >expected, but has no effect on PHP_AUTH_USER (also as expected).
      > >
      > >2. I'm using the CGI version of PHP, rather than the Apache module.
      > >I don't think this is the case, but phpinfo() reports the PHP server API[/color][/color]
      as[color=blue][color=green]
      > >"Apache 2.0 Filter", rather than anything clearcut. Does this mean I'm[/color][/color]
      using[color=blue][color=green]
      > >the module or not?[/color]
      >
      > You are using the module.
      >[color=green]
      > >For reference, I'm running:
      > >
      > >Mandrake 9.1
      > >Apache 2.0.47
      > >PHP 4.3.1
      > >
      > >Any suggestions would be gratefully appreciated - if you'd like the full
      > >output of my phpinfo(), or the exact script I'm using (although I've[/color][/color]
      tried a[color=blue][color=green]
      > >number of PHP authentication test scripts without any difference in
      > >results), then let me know. Finally, if it turns out I'm not using a PHP
      > >module, how can I set apache up so that it does? (I've tried adding
      > >LoadModule lines to my http2.conf, which doesn't make any difference).[/color]
      >
      > This appears relevant:
      >
      > http://bugs.php.net/bug.php?id=2044 1
      >
      > Are you in safe mode?
      >
      > --
      > Andy Hassall (andy@andyh.co. uk) icq(5747695) (http://www.andyh.co.uk )
      > Space: disk usage analysis tool (http://www.andyhsoftwa re.co.uk/space)[/color]


      Comment

      Working...