Saturday, June 02, 2007

PHP5 Not Working

I've setup my Desktop as a Server so I can study LAMP, Drupal, Joomla!, e107, Moodle, Claroline, Coppermine, DanPHPSupport, Wordpress, and PHP-Fusion. Setting up a server on your system is a very convenient way of learning this stuff. I just don't want the lag of setting up, troubleshooting, and studying CMS from a remote server.

There are times when you're forced to uninstall Apache 2 or you inadvertently removed it. And once you reinstall it, pages with .php extensions doesn't work. Firefox, Konqueror, Seamonkey, and Opera asks you to download it instead of load it. WTF!!! Reinstalling Apache2 doesn't work. Reinstall Apache2 and PHP5 doesn't work too.

This really sucked. I've Googled a fix for this but all the solutions I've encountered won't work on my system. Forums, IRC, and some cached mailing lists didn't help me out. So I did some research and the fix was actually so damn easy.

Under /etc/apache2/mods-enabled I didn't see any PHP5 modules. Aha! <sarcasm> I'm a Genius </sarcasm>. The reason PHP5 doesn't work is because it's not enabled (duh!). So I went to /etc/apache2/mods-available and linked php5.load to /etc/apache2/mods-enabled.

Hey, it worked! hehe.

Now if you're not comfortable doing it graphically, then issue this command:
sudo ln /etc/apache2/mods-available/php5.load /etc/apache2/mods-enabled

Blogged with Flock