Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've just installed phpMyAdmin at /usr/share/phpMyAdmin on a CentOS 5 machine running webmin / virtualmin. I have also added an alias to the apache config, being the following line:

Alias /phpMyAdmin /usr/share/phpMyAdmin

So that when I visit it serves phpMyAdmin. The problem is that the php is not being parsed, and is instead being spat out with the html which greatly diminishes the usefullness of what I have done. How can I set up apache or php or whatever to parse phpMyAdmin correctly.

When googling this I wasn't able to get an understandable answer, however the most common related question was whether I am running mod_php or as CGI. php is running via CGI


share|improve this question
is php working as it should be otherwise in that domain? – anthonysomerset Feb 28 '11 at 8:19
up vote 1 down vote accepted

Lobe, it sounds like you need the line:

AddType application/x-httpd-php .php

added to your apache configuration.

share|improve this answer
Thanks a lot, that seemed to solve it. – Lobe Feb 28 '11 at 8:36
This breaks mod_fcgid/suexec in VirtualHost sections. It's better to do this specifically for the directory you want this to work on; or to do it for specific VirtualHosts where you want phpmyadmin to run from the server-wide installation. A safer option may be to install phpmyadmin inside a virtual host, rather than using the apt-provided package, so that it can run under suexec and as a normal user (the Debian/Ubuntu package runs as the Apache user). – swelljoe Feb 28 '11 at 18:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.