Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 seen this question a couple of times already, but was not able to resolve my issues. I've recently set up a dual-boot installation of Ubuntu in order to better acquaint myself with the LAMP environment. I've set up a virtual host, and when I direct my browser to index.html within that host I get the html in the browser - but when I point the browser to index.php (which contains a phpinfo() call) I get nothing. I've tried removing/purging and reinstalling the php5apachemysql libs/mods, emptied my cache, checking the mods-available/enabled folders to no avail. Can anyone help me get to grips with this problem?

share|improve this question

There are a couple of different possibilities here. It might be that the PHP module isn't loaded but it's also an option that the files have not been set to be handled by the php module.

Either way, in /etc/apache2/modes-available/ there should be some files like php.conf (or something similar) and these should be symlinked from /etc/apache2/mods-enabled/. If they're not, than php is not enabled yet.

To enable all php-like things you can do this (as root, use su or sudo su)

cd /etc/apache2/mods-enabled/
for i in ../mods-available/*php*; do
    ln -s $i ./

After that simply restart apache and everything should be enabled. If it still isn't working than it would be useful to see the output from the log files (/var/log/apache2)

share|improve this answer
Could the command in the loop be shortened to ln -s $i? – Nerdling Aug 6 '10 at 2:36
@Nerdling: yes, it could. But personally I always specificy the path just to be sure. The entire for loop could be shortened to ln -s ../mods-available/*php* ./ I think. But as Tim Peters once said, "explicit is better than implicit". – Wolph Aug 6 '10 at 9:42
up vote 1 down vote accepted

I resolved this after looking at the PHP installation troubleshooting section of the Netbeans site, which recommended the following:

apt-get --purge remove php5-common

apt-get install php5 phpmyadmin

They omitted any explanation as to why this worked, but it did. I'd be grateful if anyone here could shed some light on why this resolved the issue.

share|improve this answer

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.