PHP pages (sometimes) not executing

Started by Dobs, December 04, 2009, 09:48:35 AM

Previous topic - Next topic

Dobs

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?

JBlaze

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?
Jason Clemons
Former Team Member 2009 - 2012

Dobs

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?

JBlaze

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.
Jason Clemons
Former Team Member 2009 - 2012

Dobs

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?

H

Do you still require assistance with this?

QuoteDo 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?
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Advertisement: