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

2 Answers

up vote 0 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

http://netbeans.org/kb/docs/php/configure-php-environment-ubuntu.html#troubleshooting

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

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 ./
done

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
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.