my PHP occasionally displays the source code by mistake

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
puzbie
Forum Newbie
Posts: 2
Joined: Tue Aug 21, 2007 12:07 pm

my PHP occasionally displays the source code by mistake

Post 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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Moved to Installation and Configuration.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post 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.
There are 10 types of people in this world, those who understand binary and those who don't
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post 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
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post by VladSun »

Interesting ...
So, nobody has been found guilty of this ;) Neither Apache Org., neither PHP community :) Excellent!
There are 10 types of people in this world, those who understand binary and those who don't
puzbie
Forum Newbie
Posts: 2
Joined: Tue Aug 21, 2007 12:07 pm

Post 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.
Post Reply