Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Oct 1999
Posts: 282
Enthusiast
Enthusiast
Offline
Joined: Oct 1999
Posts: 282
I've added these lines to my .htaccess file:

<Files blah>
ForceType application/x-httpd-php
</Files>

It does not work. The php-file "blah" is sent to the browser as plain text. I know there's a setting in the httpd.conf "AllowOverride", which has to be set to "All". But I'm on a shared server, so I do not have access to the httpd.conf.

Is there any other way to force a file type to be treated as php script?

Sponsored Links
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
There is a way around it by using a custom 404 page(a script)
Read http://www.vbulletin.com/forum/showthread.php?p=133779&mode=linear#post133779

I am using this method here:
http://www.shroomery.org/books/

Joined: Nov 2000
Posts: 210
Member
Member
Offline
Joined: Nov 2000
Posts: 210
You may have to check and make sure that the tags are allowed for the script you are using if the apache server does not recognize the script as PHP it will tell the page to display as text I think. In any event if PHP is not on the server then it wont matter what you do it wont parse as anything other than text or a download. you might have to change the file extension to php3, php4 or some other name. This may be something to contact your host about.

Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
Is it an apache server at all?

Joined: Nov 2000
Posts: 210
Member
Member
Offline
Joined: Nov 2000
Posts: 210
[] I know there's a setting in the httpd.conf "AllowOverride", which has to be set to "All". [/]
indicates it is an apache server unless httpd.conf is used as the config file on other web servers as well?

Sponsored Links
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
You´re right, I missed that detail.

Joined: Oct 1999
Posts: 282
Enthusiast
Enthusiast
Offline
Joined: Oct 1999
Posts: 282
Thanks for the hints so far, I'll try the 404 page-solution if I can find some more time...

Joined: Feb 2004
Posts: 2
zb Offline
Lurker
Lurker
Offline
Joined: Feb 2004
Posts: 2
Hello,
I had a similar problem, and it took me hours to figure out. When I installed PHP 4.3.4, it inserted this line in my httpd.conf:
AddType application/x-http-php .php
Instead of processing my php files, the source was sent to the browser. After extensive googling, I discovered that the line should be "application/x-httpd-php". So, try it without the 'd'. That must be correct for some systems, or it wouldn't be the default.

(I was installing as a module on Apache 2.0.48 under YellowDog Linux.)


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)