Home > internet, security, sysadmin > phpMyAdmin with mod_fcgid

phpMyAdmin with mod_fcgid

January 22nd, 2007 Leave a comment Go to comments

I am currently migrating my server configuration away from mod_php towards mod_fcgid (the successor of mod_fastcgi), as this allows me to use different users for executing scripts in different directories. I use this to have every hosted virtual domain using its own system user. This should (in theory) prevent one buggy application to take over all other hosted domains as well.

I though faced one problem: I could not get phpMyAdmin working and this was a requirement of one of my clients. phpMyAdmin kept popping up the authentication dialog over and over again when using HTTP Basic Authentication.

After searching some time, I noticed that, when using PHP in CGI mode, the authentication data is not passed over to the script by default. A FAQ entry of phpMyAdmin brought the solution to this issue: a ReWrite Rule was needed for the directory containing phpMyAdmin:

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

Suddenly phpMyAdmin worked ;)

  1. December 29th, 2009 at 00:15 | #1

    Thanks man…. :)

  2. Oliver
    October 18th, 2010 at 07:03 | #2

    Dear Capi

    Many thanks your sharing.
    However, I’ve tried to follow your solution but not success.
    i added the ReWrite Rule into .htaccess file.
    Could you advise how to configure it.
    Many thanks.
    Oliver

  3. JD
    October 22nd, 2010 at 19:28 | #3

    @ Oliver

    Simply create a “.htaccess” file at the root of you phpMyAdmin directory with two lines quoted in the article:


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

  1. No trackbacks yet.