Forum Moderators: phranque
I had a handler in .htaccess so I can parse .txt files as php
It doesn't work anymore. When I head to my .txt files I can now see all of the php code.
AddHandler application/x-httpd-php .txt<Files directory>
SetHandler application/x-httpd-php
</Files>
Normally, you'd use
AddHandler server-parsed .txt
or some such, while
application/x-httpd-php
would be used in an AddType directive to set the MIME-type of content delivered from files.
PHP's 'hooks' into Apache were kind of kludged-in, and all sorts of odd things 'work' that should not work. As a result, I defer to the folks who use PHP a lot more than I do over in the PHP forum... :)
Jim
I generally use a few lines (guess they're multi-useful) and they always work, on a few different servers, but I had to whittle it down to this for the one using PHP5
AddType application/x-httpd-php .htm .html
Works fine, but it took a bit of fiddling with to find what would.
and then I tried Marcia's:
which resulted in me getting a popup window asking if I should open in notepad. Did I maybe write this incorrectly?
this is what I used for Marcia's try:
in .htaccess:
AddType application/x-httpd-php .txt .php
PHP's 'hooks' into Apache were kind of kludged-in, and all sorts of odd things 'work' that should not work. As a result, I defer to the folks who use PHP a lot more than I do over in the PHP forum...
"Kludge" is a good word, I agree as do the folks at Apache. We've been down this road many times. Early on I did my fair share of investigation and still refer to this thread quite often:
[webmasterworld.com...]