Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My web application works fine in development environment, but on production server gives off:

504 Gateway Time-out
The server didn't respond in time. 

Edit: I have traced the problem to a session_start() call - it never completes and ends in a 504 error above. What could cause this?

Both servers are running Linux, although of course they are not perfect clones of each other. There are many other php apps running on the same server with no issues, the production server is not overloaded in any way, and hardware wise, the production server is much better in specs than the development one. I checked out php error log and do not see anything other than

[22-Aug-2011 09:38:01] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_sqlite.so' - /usr/lib64/php/modules/pdo_sqlite.so: undefined symbol: php_pdo_register_driver in Unknown on line 0

Which is something I see all the time even if it's working fine, and I generally don't care about this error as I'm not using sqlite.

Where else can I see what's going on and what to do to fix it?


While I could not figure out what caused the initial problem, it turned out that the problem was not occurring when using a different web browser. After restarting the problematic browser instance (it was Firefox, btw) the issue went away completely. I'm still puzzled how a browser could cause a server to throw 504 error.

share|improve this question

migrated from stackoverflow.com Aug 23 '11 at 1:40

This question came from our site for professional and enthusiast programmers.

closed as too localized by danlefree Aug 24 '11 at 21:12

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Are you using mod_proxy, passenger or something similar? – Pierre Lacave Aug 22 '11 at 13:52
How about the web server (Apache?) error log – Phil Aug 22 '11 at 13:52
you should do a google search for the error code - This problem is entirely due to slow IP communication between back-end computers, possibly including the Web server. Only the people who set up the network at the site which hosts the Web server can fix this problem. This usually means that the upstream server is down (no response to the gateway/proxy), rather than that the upstream server and the gateway/proxy do not agree on the protocol for exchanging data. – Lawrence Cherone Aug 22 '11 at 13:56
No errors in apache error log either. – SaltyNuts Aug 22 '11 at 13:59
I did do a search on this error code, but it does not seem normal that this server would have IP communication troubles - several similar apps are running there just fine, so I suspect some detail in my code is breaking it. – SaltyNuts Aug 22 '11 at 14:00