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 www.foobar.com/phpMyAdmin 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

Thanks

link|improve this question
is php working as it should be otherwise in that foobar.com domain? – anthonysomerset Feb 28 '11 at 8:19
feedback

1 Answer

up vote 0 down vote accepted

Lobe, it sounds like you need the line:

AddType application/x-httpd-php .php

added to your apache configuration.

link|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
feedback

Your Answer

 
or
required, but never shown

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