I can't get .php files to run on my server. For example, I created a test file entitled "test.php" with the following content (only):
When I try to open this or other php files through a web browser, it tries to download them rather than run them. Responses to similar questions suggest that this issue means the server isn't set up to run php. I looked up how to enable php on the server and found that I am supposed to uncomment the line
LoadModule php5_module libexec/apache2/libphp5.so
in the httpd.conf in the etc/apache2 directory. However, when I checked that file, the above line was already uncommented. Is there some other thing I need to change to make php work correctly?
( 5 months ago )
You also need to add the handler for the PHP extension, so that the scripts are actually handled by the PHP module.