Page 1 of 1

php pages sometimes empty

Posted: Fri Mar 24, 2006 12:53 am
by pelos
I have a strange problem on a sun server with php with apache. After installing the php, the php pages I am trying to put up sometimes display OK, but sometimes result in an empty page with the source
<html><body></body></html>

It is very strange, when one hits reload a number of times, sometimes the two states (empty page or real page) alternate.

There are no errors in apache error log files and the access log shows an OK transfer. I tried firefox and explorer on windows, firefox on linux, and links on linux, and all behave the same, so I dont think it's a browser. I tried many php scripts, last attempts were with the simple file shown below:
<html>
<body>
<?php echo("Hello world!<br>"); ?>
Done...
</body>
</html>

But errors were always the same, it didn't even show "Done...", which is not in a php block. All pages work fine on another linux server that has apache with php. HTML works without a problem on the server.

Anyone had a similar problem? Any ideas about a solution or ways I could test the system to identify the problem? I'd appreciate any help.

Btw, here's the phpinfo file address, if you want to try it. Does the same thing-sometimes it will work sometimes it will give you a blank page.
http://www.cs.umsl.edu/phpinfo.php

Posted: Tue Mar 28, 2006 5:20 am
by CyberSpatium
Are you saving your php files with an html extention? Doing so will cause php to not work unless apache is configured to parce php from html files. Save all php files with php extention.

Posted: Tue Mar 28, 2006 8:21 am
by pelos
No, of course php pages have php extension (like the one I listed above). HTML pages work well, PHP pages return blank page most of the time (but not sometimes).