I've developed a website on the Silverstripe framework and deployed this to a digital ocean server using centos (7.0.1406) , mariadb (10.0.14) and apache (2.4.6). I'm somewhat of a novice when it comes to system admin so set up the server following instructions in the digital ocean community docs (https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-centos-7).
I'm randomly getting the following error when I try to connect to the site:
[Warning] mysqli::mysqli(): (HY000/2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
On
$this->dbConn = new MySQLi($parameters['server'], $parameters['username'], $parameters['password']); When this occurs, I reboot the server (with 'reboot') the issue goes away. It only seems to occur with activity is happening in the CMS. My client has experienced it a number of times when trying to upload images and I have just seen it for the first time when switching pages in the CMS.
No amount of use on the front end of the website causes issues (so far at least). What could be causing this issue? Are there any actions which can be performed by a website (PHP) that could trigger this failure? Overuse of system resources/hang ups somewhere/timeouts? Where can I start my debugging process?
I've deployed numerous sites under similar environments in the past but have never encountered this except for forcing a shut down via the digital ocean control panel.