MySQL server is gone (PHP)

So, I get the following error:

Error Number: 2006
MySQL server has gone away

I can do everything, but guarantee it, because the script takes several minutes to run, and then more requests are executed in the middle of the script. Given this is only an administrative, huge script file, this is to be expected. (and quite acceptable). I think the MySQL connection is closing because PHP / MySQL / something does not keep it open. However, I can’t understand for life how to stop this timeout!

I have the following at the top of my PHP script, but it doesn't seem to help.

ini_set('default_socket_timeout', -1);
ini_set('max_execution_time', -1);
ini_set('memory_limit', -1);
ini_set('mysql.connect_timeout', -1);

Any idea how I can fix this problem? Thank!

+3
source share
1 answer

, mysql_connect , mysql_query. , .

- . mysql_ping , , , . @galador answer.

@diolemo @galador.

+7

All Articles