We help IT Professionals succeed at work.

Mysql.conect_timeout php while uploading

zotteke123 asked
Last Modified: 2007-12-19
I have got an upload srcript on a server.. The server ini file for mysql.connect_timeout is 60seconds on the server. I try to get past this buy setting ini file settings during runtime
The variable $result is indeed the 6000seconds I want it to be...
But still the page tells me "mysql server has gone away"
This does not happen when I upload and complete a file within 60 seconds.

In need of help
$resultjen = ini_set('mysql.connect_timeout','6000');
set_time_limit (6000);
$result =  ini_get('mysql.connect_timeout');


Watch Question

In my humble opinion when PHP.INI declares timeout values, then this is the time PHP will wait for MYSQL server to reply. On other side of connection there is MYSQL server with his own timeouts about how long to listen to a client, how long client can be idle and so on.

So analyse result of SHOW VARIABLES; query to your server.
Try to measure script execution time and play with your configuration options to figure out which timeout ends first.

Make your local timeout less than 60 seconds (30 for example) and compare executing time and error messages.


Did that..
I got tired of looking so I turned to writing the images onto the server itself in folders
This one is on us!
(Get your first solution completely free - no credit card required)
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.