The comments thread had a bunch of useful troubleshooting tips but it turned out the issue was with the browser. I recommend having a spare, 'pristine' browser for testing, so if your mimetypes are messed up, you can still check. The OP installed opera and it worked, when firefox didn't. In his shoes, I might consider purging firefox - which eliminates all config files (though resetting it may work) and reinstalling.
Other things worth testing for (Via comments made by myself, agtoever and Dragonlord)
- Check if apache is running with
sudo service apache2 status
- Check package installs
sudo apt-get install php5 libapache2-mod-php5 to make sure apache and the apache/php module is installed. If they are freshly installed, make sure apache is restarted with sudo service apache2 restart
Make sure mod_php5 is set up to load when Apache is started. There should be a file in /etc/apache2/mods-enabled called php5.load with the text LoadModule php5_module /usr/lib/apache2/modules/libphp5.so (source). If not, you might want to add this line to /etc/apache2/apache2.conf:
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
- Check file permissions.
telnet 127.0.0.1 80 to do an oldschool web server test.After some output, type "GET" and enter. Also try this with "GET index.php". This checks if apache2 actually serves your processed php file
- Check the settings in Firefox and Bluefish. In bluefish go to Edit, Preferences, External Programs. Under Browsers, Mozilla & Opera's command should read: "firefox %s". In Firefox, go to Help, Troubleshooting Information, Profile Directory: Show Folder. Try to delete the mimeTypes.rdf file in the Firefox Profile Folder.