HTTP authentication on Apache 1.3 with php

Hi,

I've just inherited a website, and I'm not sure on how some of the code functions..

It uses this bit:

if ( isset( $_SERVER['PHP_AUTH_USER'] ) ) {

And seems to auth off of a password file in the main dir, at least so far as I can tell from reading documentation..

I'm on a Fedora machine, running Apache 1.3.. It's also a Cpanel setup (With WHM)...

In /usr/local/apache/conf/sites I have a file called sitedomain.com.conf (Sub sitedomain for actual domain name)..

It contains information like:
 <Location "/askjohn">
                AuthName "Member Area"
                AuthType Basic
                AuthUserFile /home/domain/public_html/wfmpasswd
                Require valid-user
</Location>


Can someone clue me in on what else might be misssing? When I hit the pages that should auth, nothing happens..

Thanks
David
dwessellAsked:
Who is Participating?
 
Computer101Commented:
PAQed with points refunded (250)

Computer101
EE Admin
0
 
dwessellAuthor Commented:
I added a htaccess file, and I can auth.. However, the variable $_SERVER['PHP_AUTH_USER'] always evaluates to false..

If I run a phpinfo, then I see that there are values there... Any suggestions?

Thanks
David
0
 
dwessellAuthor Commented:
die(print_r($_SERVER['PHP_AUTH_USER']));

Always prints 1...
0
 
dwessellAuthor Commented:
Figured it out, required a <Directory> directive in Apache's httpd.conf..

Mod's feel free to close..
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.