HTTP Basic Authentication with PHP

Let us see how to use HTTP Basic Authentication with PHP on the Apache web-server.

It relies on the environment variables PHP_AUTH_USER and PHP_AUTH_PW.

You may test it here. Notice that,