I've looked at several other questions on stackoverflow dealing with this issue HTTP Auth via PHP - PHP_AUTH_USER not set? and PHP_AUTH_USER not set? , but they all point at issues with "Server API" being set to CGI, for me it's set to "Apache 2.0 Handler".
I'm using UBUNTU 12.04LTS.
I have a simple script in my docroot called my.php:
<?php
echo "Username: " . $_SERVER["PHP_AUTH_USER"] . ", Password: " . $_SERVER["PHP_AUTH_PW"];
?
When I run wget, I can see that both are empty:
wget -v --http-user=johnsmith --http-password=mypassword http://192.168.1.163/my.php
returns:
Username: , Password:
I have the following apache modules enabled:
/etc/apache2/mods-enabled
alias.conf authn_file.load authz_host.load autoindex.load deflate.load env.load negotiation.conf php5.load rewrite.load status.conf
alias.load authz_default.load authz_user.load cgi.load dir.conf mime.conf negotiation.load reqtimeout.conf setenvif.conf status.load
auth_basic.load authz_groupfile.load autoindex.conf deflate.conf dir.load mime.load php5.conf reqtimeout.load setenvif.load
I also tried adding a line to my .htaccess for "AuthType Basic" to no avail.
Is there something else that needs to be set or config'ed?