phpMyAdmin with mod_fcgid – http auth with CGI

One of the mod_fcgid benefit is using different user for executing scripts in different directories (for example every hosted virtual domain has its own system user which can only execute his own scripts). This is a some kind of protection so one exploited site can’t harm other hosted domains (of course, chmod 600 on config files is a MUST).

Unf. phpmyadmin has problems with php in CGI mode. When using HTTP basic authentication, phpMyAdmin kept popping up the authentication dialog over and over again. The solution is to create .htaccess file inside phpmyadmin web dir with next content

RewriteEngine On
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]

According to phpmyadmin documentation, when using PHP in CGI mode, the authentication data is not passed over to the script by default and the lines in .htaccess shown above should fix this problem.

1 thought on “phpMyAdmin with mod_fcgid – http auth with CGI

Leave a Reply

Your email address will not be published. Required fields are marked *