Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

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

1 Answer

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
add comment

Your Answer

 
discard

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.