Search code examples
phpnginxhttp-authenticationfpm

How to unset $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] in PHP 7.3


I installed APC status page script on my server to see APC status. This lets you set a username and password via HTTP Authentication to view more detailed information.

Once logged in via HTTP Authentication, php info has set $_SERVER['PHP_AUTH_USER'] $_SERVER['PHP_AUTH_PW'] and now all HTTP requests on the server are failing because it asks for authentication.

How can I unset or disable this in PHP? I have no intention of using that script again and it's affecting operations of other files on the server.

Thanks in advance.

Restarting PHP FPM and Nginx. Clearing Application Caches.


Solution

  • you can use apc_clear_cache() function. Please refer to related question on SO. How to clear APC cache entries?