The configuration file /etc/apache2/mods-available/php5.conf
controls which files Apache recognizes as php scripts (based on their extensions).
Be default (in PHP 5.3.2), the file contains the following code:
SetHandler application/x-httpd-php
This affects files with the following extensions:
From our discussion in chat, I know that your files have a html
extension. The server was configured to treat .html
files as php files, but your home computer is not. That leaves you with two options:
manpreet
Best Answer
2 years ago
I have L-Ubuntu 11.04. I've installed Apache2 and I'm trying to simulate a server on my local file system by navigating to
localhost
in the browser.The problem is that I can't seem to get php to execute when on localhost. The PHP code is simply printed in the browser (instead of being executed and the result being printed).
libapache2-mod-php5
is installed and the latest version.How can I get PHP to run on localhost?