Mortgage Calculator - Download Firefox Extensions and Themes - Buy Shares - Loans - Electricity Suppliers

PDA

View Full Version : Newbie needs help with parsing


lionclaw
Aug 5th 2007, 2:35 pm
I have just installed Apache Server 2.0.52 and PHP (5.2.3) on my home computer (Windows XP) so that I can learn PHP and practice using other web technologies more easily. The installations seemed to go alright, as I followed directions as closely as possible. For the most part they are working adequately EXCEPT for parsing PHP in HTML files. As a newbie I am probably making some obvious mistake, but no matter how much I play around with the configurations I cannot get the PHP to work in the html files. I even adding a .htaccess file with:

Remove handler .html .htm
Add type application/x-http-php .php .htm .html

as someone suggested, but this too didn't help.
The lines I played around with the most in the httpd.conf file are:

AddType application/x-httpd-php .php .htm .html
AddType text/html .shtml .html .htm .php
AddHandler server-parsed .shtml .html .htm .php
AddOutputFilter INCLUDES .shtml

Can someone please set me straight?

Thank you

bilal@revolutionhosting
Aug 5th 2007, 7:11 pm
Is PHP working within .php files? Or not at all?

If it's working within .php files, and you have PHP loaded as an Apache server module (mod_php), then the only line you should need is:

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

If it's *not* currently working in .php files, check to make sure you have the configuration line:
LoadModule php5_module "c:/php/php5apache2.dll"
(obviously adjust the path for your system)

See the following page in the PHP manual for further information:
http://www.php.net/manual/en/install.windows.apache2.php

lionclaw
Aug 5th 2007, 9:54 pm
PHP is loading with .php files. Not with .html though.

lionclaw
Aug 5th 2007, 10:59 pm
ahhaaa. Success!
I got rid of everything else and ONLY put
AddType application/x-httpd-php .htm .html
and it works.
Thanks