I have PHP5 installed on my CentOS 5 server running Apache 2.2.3 (did a yum install)
I ensured the httpd.conf file has all the necessary AddType and LoadModule commands. Even tried restarting httpd.
But when I run a php file, instead of it being executed, the file just downloads. Any ideas what I might be missing?
I did see the different threads returned by Google. Also tried the solutions posted on other similar SF questions (here and here) but didn't find a resolution. Tried a manual install of php as well. But php files just don't get executed.
Now I can get the php file to show and not get downloaded. From the httpd.conf, removed the AddType directive and added AddHandler.
On further investigation, if I run a command
php -f my_php_file.php on my server, the file executes fine. So php installation is not the issue. But somewhere in the configuration file, the mapping is missing (i.e. execute .php files using php). Any ideas?