Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I always get a 30s script timeout when I do a long database search (>30s) via a https connection from a remote place to an apache+PHP+PostgreSQL server.
Most strange is that my php.ini contains much longer script timeout value, and in fact I do not have the timeout when I do the same database search from within the LAN where the server resides.
I do not have the timeout when I access a static page or download a large file from the same server from the outside, either.
So it seems as if the timeout would only concern dynamic PHP pages and only if they are accessed from outside of the LAN.
Have you ever experienced such PHP behaviour? Is there a workaround?
I had a problem with this kind of thing a while back. It came down to two things. The first was it took a while for the script in the page to run since it was doing a lot of different things (db queries, copying files to servers, untarring things, etc.). The second problem was with the browser. If the browser wouldn't receive any data from the server within a given period of time, about 30 seconds or so, it would give up on loading the page.
I got around the problem by using "flush()" in the page. This would send the buffered portion of the page that had been built to the browser. That was the only change I made and it cleared the problem up. Using this method the browser can wait a lot longer, up to 5 minutes, for the page to completely load before it will give up.
You may be right in that my script does not return anything to the browser until the query is fully completed. Though it could send the page header right at the beginning.
So I will try the flush() command to force PHP to send the page header before the query is run.
However, if it is the browser that times out the connection, why do not I get the timeout when I connect to the server with the same browser but from a local client?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.