1

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?

2
  • One way to diagnose the problem is to add an echo __LINE__; ob_flush() before all susceptible lines and run your script. Commented Dec 20, 2012 at 15:01
  • One word: Debugging. Reproduce it on your development system and use a debugger like XDebug to step through the code. Commented Dec 20, 2012 at 15:02

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.