If you installed PHP via package (like yum -y install php
), then you should have an /etc/httpd/conf.d/php.conf
that specifies the needed entries. If apache was running when you installed php, then you have to restart apache for it to pick up the configuration changes.
If you installed from source, you need to make sure the following directives are included in your httpd.conf (or an include)
LoadModule php5_module modules/libphp5.so
AddHandler php5-script .php
AddType text/html .php
DirectoryIndex index.php
The AddType and AddHandler directives are specifically needed to tell apache how to send files that end w/ .php. Otherwise, it will send with a default MimeType, which your browser will then prompt you to download as you are seeing.