homepage Welcome to WebmasterWorld Guest from 107.20.25.215
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
php won't autoprepend an htm file
kwc_jr




msg:4420715
 2:13 am on Feb 23, 2012 (gmt 0)

I have tried several settings in .htaccess each of which appear to get my .htm files in the directory being parsed by php which is what I want. Some I have tried that seem to work in that they do get htm to be processed by php are:

AddType application/x-httpd-php .htm
AddType php5-script .htm
AddHandler application/x-httpd-php .htm
AddHandler php5-script .htm

Unfortunately, my php autoprepend file, set in php5.ini, is not running. It get run when it should when accessing a .php file but not processing any .htm files. If I rename the files from .htm to .php they work correctly, but when I rename them back to .htm files the autoprepend does not happen and they break.

I have done this many times before without a problem, but not this time. Is there something else I need to do that I have forgotten?

Driving me nuts!

Thanks
Ken

 

incrediBILL




msg:4420717
 2:32 am on Feb 23, 2012 (gmt 0)

Try doing it like this in .htaccess:

#make all .htm/,html run PHP
AddType application/x-httpd-php .htm .html

#prepend a PHP script to all files
php_value auto_prepend_file "/var/www/vhosts/example.com/httpdocs/somescript.php"

Also try restarting the web server, sometimes you need to restart HTTPD when odd things happen like this.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved