Simple Machines Community Forum

SMF Support => Server Performance and Configuration => Topic started by: Dobs on December 04, 2009, 09:48:35 AM

Title: PHP pages (sometimes) not executing
Post by: Dobs on December 04, 2009, 09:48:35 AM
Hi all,

I have been changing something in .htaccess to update the PHP handler from PHP4 to PHP5 and now some PHP pages no longer execute but the browser asks to open/save them.

This happens only in some cases (seems to be session related) i.e. with Logout and only in some browsers.

The line in .htaccess is now:
AddHandler application/x-httpd-php5s .php

What is wrong here?
In general, what can I do to prevent php files being sent to to browser in raw form?
Title: Re: PHP pages (sometimes) not executing
Post by: JBlaze on December 04, 2009, 10:03:06 AM
AddHandler application/x-httpd-php5 .php

Or you could also use
SetHandler application/x-httpd-php5 .php

Remove the "s" after php5 :P

anyways, why do you need to do this? If your server is using PHP5+ then there is no need  for this?
Title: Re: PHP pages (sometimes) not executing
Post by: Dobs on December 04, 2009, 10:25:17 AM
With my host, the s makes it possible to use only one php.ini (in public_html) that also applies to all lower folders. Without this s, i would need to copy it to all subfolders with php in it or otherwise these would use the server's master php.ini , which may contain different settings than my php.ini.

Do you think it is possible that this causes the problem?
Title: Re: PHP pages (sometimes) not executing
Post by: JBlaze on December 04, 2009, 10:27:15 AM
That's a very odd server config. I'll see if I can't get someone more knowledgeable with servers to help you as this is beyond me.
Title: Re: PHP pages (sometimes) not executing
Post by: Dobs on December 07, 2009, 10:15:52 AM
Is it possible that this depends on browser type or cookie/cache state?
I'm asking because the problem only seems to happen in some situations.

What should I do to ensure PHP files are never ever presented to browsers in raw format?
Title: Re: PHP pages (sometimes) not executing
Post by: H on December 30, 2009, 03:30:41 PM
Do you still require assistance with this?

Quote
Do you think it is possible that this causes the problem?

Did you try temporarily changing to the servers php.ini to see if this fixed the problem?

Did you check the server error logs (in the web hosting control panel) to see if Apache is giving any errors?