Advertisement:

Author Topic: PHP pages (sometimes) not executing  (Read 5218 times)

Offline Dobs

  • Newbie
  • *
  • Posts: 8
PHP pages (sometimes) not executing
« 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?
« Last Edit: December 04, 2009, 09:57:59 AM by Dobs »

Offline JBlaze

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,175
  • Gender: Male
    • jason.p.clemons on Facebook
    • jasonclemons on GitHub
    • jasonclemons1 on LinkedIn
    • @fragicide on Twitter
    • My Blog
Re: PHP pages (sometimes) not executing
« Reply #1 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?
Jason Clemons
Former Team Member 2009 - 2012

Offline Dobs

  • Newbie
  • *
  • Posts: 8
Re: PHP pages (sometimes) not executing
« Reply #2 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?

Offline JBlaze

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,175
  • Gender: Male
    • jason.p.clemons on Facebook
    • jasonclemons on GitHub
    • jasonclemons1 on LinkedIn
    • @fragicide on Twitter
    • My Blog
Re: PHP pages (sometimes) not executing
« Reply #3 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.
Jason Clemons
Former Team Member 2009 - 2012

Offline Dobs

  • Newbie
  • *
  • Posts: 8
Re: PHP pages (sometimes) not executing
« Reply #4 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?

Offline H

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,662
  • Gender: Male
Re: PHP pages (sometimes) not executing
« Reply #5 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?
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)