Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.