From ae1b16914f8782623104577bf7fc123cb54884c0 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 21 Oct 2014 22:12:03 -0700 Subject: [PATCH] web: don't use persistent connections with mysqli I recently changed the web code to use the PHP mysqli interface if available. I noticed that it often get "can't connect - too many connections" errors, even on small projects. This is probably due to the use of persistent connections, so I took that out. --- html/inc/db_conn.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/html/inc/db_conn.inc b/html/inc/db_conn.inc index 0a076516d6..9cd864e550 100644 --- a/html/inc/db_conn.inc +++ b/html/inc/db_conn.inc @@ -34,7 +34,8 @@ class DbConn { } else { $port = null; } - if (version_compare(PHP_VERSION, '5.3.0') < 0) { + //if (version_compare(PHP_VERSION, '5.3.0') < 0) { + if (1) { // don't use persistent connections for now $this->db_conn = new mysqli($host, $user, $passwd, $name, $port); } else { $this->db_conn = new mysqli("p:".$host, $user, $passwd, $name, $port);