PHP Page not loaded in first attempt



Hi All,

I have some new php pages on my webserver along with few other old php pages. My old php

pages are loaded always in the first attempt from the browser. But I have a strange problem

with new php pages. When I put the link on the address bar and hit enter on IE or FireFox

sometimes it shows page cannot be loaded, sometimes the page is loaded in first attaempt,

sometimes after trying 5-10 times the page will be displayed. Once if the page is opened if

I click on any link on that page nothing happens, after hitting 5-10 times on that link

sometimes it will go to that page or fails even after many attempts. Please help what can I

do? I am a newbie and I do not know what to do with this problem.

Any help will be sincerely appreciated.

Send some of your code so we can see if there is any clue in there...

Hi Again,

My php version is 4.3.2 and exactly at this point I am facing problem.

$data_auth = CData_Layer::singleton("auth_user", $errors);

echo "here";exit; before this statement work but if I include echo statements before this as echo "here1";exit; and after that as echo "here2";exit; none works and prints anything. Only one echo after that above code also prints nothing so I think this line of code is responsible but I am not sure why it is working sometimes. Also If I call exit "hi";exit; before the above line of code, it always works and prints hi. Please tell me what should be done.

I haven't done much with classes in php 4 but this looks like php 5 code to me...

Have you tried to run this on a server with php 5?
Thanks for the reply.

Please tell me why it works some times. Use ashok and ashok as username and password, just try opening after repeated attempts it works.
I think it is an Apache issue. It sometimes doesn't recognize PHP files and atempt to download them.
Make a simple test. Create an .htaccess in your root dir with the next code, just so see what happens:
AddType application/x-httpd-php .php

Thanks for the reply.

The current unix box is my company webserver and there are many php files on it which are working perfectly. I do not know why I am facing problem only with these files and more particularly at these lines of code

$data_auth = CData_Layer::singleton("auth_user", $errors);
I've found that when the page isn't shown, even the header doesn't come accross...

Have you checked the apache and php logs for any clues?