HTTP / 1.1 504超时响应

I run a program which downloads data from a site and save it in a folder with file_get_contents. Simultaneously I insert the data (title etc) in my mysql database. Suddenly one day my program stopped and returned me this "The web service endpoint returned a "HTTP/1.1 504 Timeout" response". I use wampserver (PHP). Does anyone know how to fix this? Thank you.

Your PHP code is executing something in a loop or fetching data from the web server and has not responded back with any data. While your web server waiting for PHP to respond the request timeout was reached.

The best way to debug this issue is going through step by step in the specific script and add breakpoints to debug.

If you use a remote debugger supported IDE then you can easily do this within your IDE.

Zend Studio is easy to setup and get running.