Sometimes when I open my error log file I see this this error
[14-Jun-2014 19:09:55 UTC] PHP Fatal error: Uncaught exception \'PDOException\' with
This is a limit of database's configuration. If you have permission to edit the configuration file of your database service, you can change max_connections
value.
Take a look: http://dev.mysql.com/doc/refman/5.5/en/too-many-connections.html
You can try running this SQL query (take care about this value!)
SET GLOBAL max_connections = 512;
and this to get current value of all variables:
SHOW VARIABLES;
or (for specific variable):
SHOW GLOBAL VARIABLES LIKE '%max_connections%'
By the way, try to set PDO object
to null
when you don't need it. This will close connection to your database and PHP does not wait for script to finish to close active connections. (Oh, you did it, sorry, I will not edit it to delete. Get it as a note)