Getting PHP to parse .html?

gmdavis

Registered
After enabling Apache and PHP on my Mac (OSX Jaguar) I have been exited about using it as a development environment for my PHP scripts. This has been great to test code without uploading it to my web hosting service.

The problem I have is I cannot get .html files to be parsed by the PHP engine.

First, I edited the .htaccess file in my Sites folder by adding the code:

AddType application/x-httpd-php .htm .html

(This worked on my web server but not on my Mac.)

Then, I found out I had to edit /etc/httpd/httpd.conf to change the line AllowOverride None to read AllowOverride All. I did this but it didn't work. I still cannot get html files to process the php within. What do I need to do next?
 
You may need to install a new build of php or perhaps your permissions are not set properly. This is just a guess--I haven't had this problem.
 
Thanks for the reply. I am using the PHP that shipped with Jaguar (4.1.2). I didn't think it was necessary to go through the pain of installing an update with the command line interface. Maybe I was wrong.

Anyway, I found that I can change a similar "AddType" line in the httpd.config file and it worked.

I admit I am a newbie. Lots to learn. Still, I am amazed at all the cool stuff I have already done with PHP.
 
Back
Top