Probably the server doesn't recognize the script as executable, and that's why it offers it as a downloadable file.
These lines should be present in your Apache config. Note that the path may need to be changed for the .so
modules, depending on your configuration:
*nix:
# -- if you're using PHP 5, uncomment this line to activate it
LoadModule php5_module libexec/libphp5.so
# -- if you're using PHP 4, uncomment this line to activate it
#LoadModule php4_module libexec/libphp4.so
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
Windows:
# -- assuming PHP 4
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
Restart the Apache service and PHP should load into Apache to run just fine.
You might also want to make sure your php.ini
file is located where you want it to be, which should generally be where you have PHP installed, e.g. c:\php
. In order to do so, you'd add the following directive in Apache's configuration file:
# configure the path to php.ini
PHPIniDir "C:\php"