Jump to content

Keep a connection alive?


ItsPawl

Recommended Posts

Im using mysql with a php script in which is start by connection to the database, and when the script has completed at the very end i close the connection. The problem is that the connection keeps closing on its own during execution.

Does anyone know how i can increase the time the connection stays alive and where i would go to configure that?

Link to comment
https://forums.phpfreaks.com/topic/229140-keep-a-connection-alive/
Share on other sites

Perhaps you could be more specific? Im not finding any where to set options (using mysql server 5.1 on windows XP with apache). I am pretty new to using mysql.

 

Should say that im not sure that it is acctually getting a time-out. But it seems that way, since putting another connect in the middle of the code fixed the problem temporarily. Also i am using phpMyAdmin, and i can see some database variables but i can not change them from there (timeout is set to 10, and my script runs for 40-45 seconds).

  • 3 months later...

max_execution_time is set in php.ini and is 30 seconds by default.  If your query is taking longer than that you need to increase that script execution time.

 

But just as important, why are you making users wait that long?  Isn't there a way you can break down the info/query so they don't have to go get a cup of coffee before getting a response to the query?

Are you serious? This thread is 1 month and 18 days old.  Why are you digging up old questions and attempting to answer them?  It doesn't help whatsoever.  Unless of course the OP actually logs back in, after all that time and checks.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.