1
votes

I'm running a PHP application on Apache (XAMPP Server 1.6.6.a on Windows) and getting a strange behaviour after some server reboot. The script hangs but I can't figure out where because the PHP error log gives me no clue where it hangs exactly. I locate the problem at the PHP side because Apache gives me no error log and the page stops loading after 60 seconds (with matches mith the PHP max execution time = 60 and not with the Apache timeout = 300).

This is the relevant php.ini:

max_execution_time = 60
error_reporting  =  E_ALL
ignore_repeated_errors = Off
ignore_repeated_source = Off
error_log = "C:\xampp\apache\logs\phperror.log"

And this the httpd.conf:

Timeout 300
ErrorLog logs/error.log
LogLevel debug

What can I do to let PHP show me where the problem lies?

1
One way to diagnose the problem is to add an echo __LINE__; ob_flush() before all susceptible lines and run your script. - Salman A
One word: Debugging. Reproduce it on your development system and use a debugger like XDebug to step through the code. - KingCrunch

1 Answers

1
votes

Put in a load of:

trigger_error("Script reached line " . __LINE__, E_USER_NOTICE);

at various points in the code to work out where the code stops.