logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Apache2 serves PHP source sometimes
Author
gomtuu



Joined: 08 Apr 2008
Posts: 1

PostPosted: Tue 08 Apr '08 22:09    Post subject: Apache2 serves PHP source sometimes Reply with quote

I have a production Linux/Apache2/PHP4 web server that's not working quite right. Every once in a while (something like once every few thousand requests), Apache serves the PHP source of a page instead of executing it and serving the result. Note that this only happens very occasionally; over 99% of the time it works just like it should. So it's not a "you forgot to turn on PHP" problem. I've tried searching Google and this forum, but all I seem to be able to find is basic configuration stuff that would prevent PHP from working at all. I also posted this to a PHP forum and got no replies, so I hope someone here can at least point me somewhere helpful.

I don't see anything in Apache's logs or syslog that would indicate a problem. The Apache logs do show that when this happens, the size of the content served is equal to the PHP source file's size. But it otherwise looks normal. If there's any clue in the logs, I haven't found it.

If anyone can help at all, I'd appreciate it. It's not just annoying, but a potential security issue as well, so I'd like to get it fixed.

Linux 2.6.18-amd64
Apache 2.2.3
PHP 4.4.4

Thanks,
gomtuu
Back to top
tdonovan
Moderator


Joined: 17 Dec 2005
Posts: 611
Location: Milford, MA, USA

PostPosted: Wed 09 Apr '08 6:03    Post subject: Reply with quote

Since no one else seems to have reported it, and there is no information except "it happens occasionally" and "the log shows nothing helpful"
- I doubt you will get an answer based on that information alone.

Setting the Apache LogLevel to debug in your httpd.conf file might provide better information in your error log. This will make your log file grow very rapidly - so only leave it at debug until the error occurs once.

If you have a development machine, it would be a good idea to set it up as close to your production configuration as you can, then try to reproduce the problem by stress testing with something like Apache flood.

If you can reproduce the problem on your development system - you could then try removing and updating software components until the problem disappears. That should narrow down the cause. Some suggestions:
    * Remove any 3rd-party modules you are using (remove them one at a time so you learn which one causes the problem)
    * upgrade PHP to a more recent version (version 5.2.5 is the current release)
    * upgrade Apache to a more recent version (version 2.2.8 is the current release)
I hope these suggestions are helpful.

-tom-
Back to top


Reply to topic   Topic: Apache2 serves PHP source sometimes View previous topic :: View next topic
Post new topic   Forum Index -> Other Software