httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BAO RuiXian <ruixian....@pp.inet.fi>
Subject Re: [users@httpd] using php in header file
Date Mon, 26 Apr 2004 19:41:23 GMT


David Benson wrote:

>>I am sure there is somewhere to tell apache or php which file extensions to
>>use as php files but I can't remember where it is.
>>
>>perhaps someone else out there could tell us?
>>    
>>
>[snip...]
>2. Apache knows which files to treat as PHP files...
>
>	# Tell Apache to feed all *.php files through the PHP module
>	AddType application/x-httpd-php .php
>  
>

I think you can add .html .htm etc. after .php in the above line. Then, 
you can execute the php code in a file ending with .html and .htm, but 
it will consume much of resources from the server due to all .html and 
.htm files have to be parsed/executed by the PHP engine.

Best

Bao

>3. If you want to treat index.php as a default (IMO, good idea)
>
>	# If you want to allow index.php to be default...
>	DirectoryIndex index.php index.html
>
>
>I hope that helps...  Maybe someone else can chime in about the template/head 
>file issue...  :-)
>
>
>Regards,
>David Benson
>
>
>On Monday 26 April 2004 12:03 pm, tony wright wrote:
>  
>
>>On Monday 26 April 2004 19:27, Billy Bacon wrote:
>>    
>>
>>>I'm not sure if I can do what you are suggesting.... I tried putting some
>>>php code in an .htm file and the php code never got executed so I stop
>>>attempting that route... I think it has to do something with the Perl/CGI
>>>scripts and how the 'template' code is sent to the browser and it's not
>>>executed on the server, therefore the php code never gets executed :-/
>>>      
>>>
>>I am sure there is somewhere to tell apache or php which file extensions to
>>use as php files but I can't remember where it is.
>>
>>
>>    
>>
>  
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message