|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
PHP includes problem...
Hi-
I am running a local server on Windows 2000 for testing...In a .html file I have: <?php include "nav.inc"; ?> I want this include to be parsed within the .html file. -->In httpd.conf I added .html to the addtype line, nothing happens still. What could be going wrong here? I changed the httpd.conf file as follows, AddType application/x-httpd-php .php4 .php .htm .php3 .inc to: AddType application/x-httpd-php .php4 .php .htm .php3 .inc .html -->Any help would be greatly appreciated, M |
|
#2
|
|||
|
|||
|
RE: PHP includes problem...
Have you restarted the apache server since making the change?
|
|
#3
|
|||
|
|||
|
RE: PHP includes problem...
Anytime you put any PHP code inside a file, the file needs the extension .php. Change .html to .php and it will work, considering your server is configured properly.
|
|
#4
|
|||
|
|||
|
RE: PHP includes problem...
from Evilive
------------------------------------- Anytime you put any PHP code inside a file, the file needs the extension .php. Change .html to .php and it will work, considering your server is configured properly. ---------------------------------------- thats wrong, if you read the post correctly, he/she said AddType application/x-httpd-php .php4 .php .htm .php3 .inc .html meaning that any html files loaded will be parsed by php before being sent out. thats why sites like ign.com have .html extensions on their site, but are dynamically driven. Anonymous, try this on its own line? add AddType application/x-httpd- .html if not try chaning it to .php, if that works, it means that your httpd.conf isnt registering the .html extension. also if you change your httpd.conf make sure you restart apache, otherwise it will be treated as a normal html file |
|
#5
|
|||
|
|||
|
RE: PHP includes problem...
Good point!
However by adding .htm .html to the directive, wouldn't that require extra processing by the web server even if it was a static .htm/.html file? Which would mean that you pages wouldn't be served as promptly. Any thought? |
|
#6
|
|||
|
|||
|
RE: PHP includes problem...
Yeah adding html files to the directive will definately increase processing as everything will go through the PHP parser....
|
|
#7
|
|||
|
|||
|
RE: PHP includes problem...
Awesome, thank you for all your help you guys! I thought everything would happen in real time so I didn't think to restart Apache. I'm signed on now as WhattheF --> Thanks again.
Matt |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Installation > PHP includes problem... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|