Page 1 of 1

my PHP occasionally displays the source code by mistake

Posted: Tue Aug 21, 2007 1:48 pm
by puzbie
Hi,

First time on this site. Looks like there is lots of useful info here.

One of my websites has a number of PHP pages, which normally display fine. Every so often though, say, 1 in 100 clicks, the web page won't be displayed. Instead, the php source code gets displayed instead.

I've done a search on your forum, and from what I could find, the source getting displayed normally means that PHP isn't installed. However, I know that PHP is installed, because normally it all works fine!

Any idea what might be going on, and how I can fix it? The server is running Apache and I don't have any admin control over it. However, the helpdesk at the hosts have said they will look into it.

Posted: Tue Aug 21, 2007 1:49 pm
by John Cartwright
Moved to Installation and Configuration.

Posted: Tue Aug 21, 2007 3:19 pm
by VladSun
I have a similar problem, when using header("Location: *.php") - for every request PHP source is displayed. There are two identical (by software) servers, but I have this problem only with one of them.
Apache/2.2.3, PHP 5
This is the SquirrelMail index.php which causes the problem.
Still unsolved.

Posted: Tue Aug 21, 2007 4:30 pm
by pickle
International PHP Magazine just had an article about this very subject, rooted in the problem some people report about Facebook:

http://www.php-mag.net/magphpde/magphpd ... eid,5.html

Posted: Tue Aug 21, 2007 4:36 pm
by VladSun
Interesting ...
So, nobody has been found guilty of this ;) Neither Apache Org., neither PHP community :) Excellent!

Posted: Wed Aug 22, 2007 1:24 pm
by puzbie
Oh well. At least I know I'm not alone! :lol:

Luckily if I include additional PHP files they don't get displayed, the only one visible is the first one, so I can tuck most of the code away.