Forum Moderators: coopster

Message Too Old, No Replies

Switching to php5 broke apache handlers

         

jake66

9:57 am on Jan 16, 2008 (gmt 0)

10+ Year Member



I upgraded my VPS to php and mysql 5.

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>

Is there a change I have to implement to get it working again?

Marcia

10:32 am on Jan 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Jake, going by what was posted in the other thread, it isn't qute clear what it is you want to do. Do you actually have files you want to use php code on with a .txt file extension? Are you using pages like this on your site?

www.example.com/page.txt

Or do you want to use .txt files as includes to be included on pages with an .html extension? Are your pages like this? Which are you using?

example.com/page.html

When I moved a site to a host with PHP5 what I had used with PHP4 didn't work, I had to play a bit and got this to work to use .php on .html (or .htm) pages, it works for using .php with either file extension:

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

But you posted an example you tried in the other thread which didn't work for you:

AddType application/x-httpd-php .txt .php

Why did you have .php in there?

phranque

10:39 am on Jan 16, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



since a couple of potential solutions were already tried while this was posted in apache, here is jake66's original thread for reference [webmasterworld.com].

coopster

1:53 pm on Jan 16, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I answered in the Apache thread as well (thinking of possible future readers). Have a look at this message that describes some of the differences and see if you find resolution:
[webmasterworld.com...]

jake66

4:14 am on Jan 17, 2008 (gmt 0)

10+ Year Member



what it is you want to do. Do you actually have files you want to use php code on with a .txt file extension? Are you using pages like this on your site?

Yes, that is correct. It worked before the switch to php5, Apace is still the same version.

AddType application/x-httpd-php .txt .php

Why did you have .php in there?


Typo :)

I deleted this entry via cpanel and re-created it, still no luck. I tried a number of variations posted on this site and around the web and I still can't get it to work. Is there possibly a security function I have to enable/disable on the VPS to allow this parsing to take place?