Page 1 of 1

PDO error - mysql5.sock missing, not loaded

Posted: Thu May 29, 2014 7:43 pm
by davidgwalker
I have received the following from David H (thunderpoet), it relates to "" managed server, but may also be useful to those experiencing the issue on other servers too.

    I finally found the answer at ... 27/support

    Even though my php.ini file usually works for any other connection with just this to connect to the mysql 5.4 server on my exclusive hosting server --

    register_globals = off

    mysql.default_socket = "/tmp/mysql5.sock"
    mysqli.default_socket = "/tmp/mysql5.sock"

    APPARENTLY step 1 to make your product work needed this, too, in the php.ini

    ini_set('mysqli.default_socket', '/tmp/mysql5.sock');
    ini_set('mysql.default_socket', '/tmp/mysql5.sock');
    ini_set('pdo_mysql.default_socket', '/tmp/mysql5.sock');

    there are 2 duplications here but I left the original top lines in for the time being while using the "ini_set" as well.

    Then, I had to change the PDO connection in your pjsfiles/functions.php at lines 393 to 398.

    I had to add the unix_socket for happiness (and mine)

    try {
    $this->dbconn = new PDO(DBDRIVER.":host=".DBHOST.";port=".DBPORT.";dbname=".DBNAME.";unix_socket=/tmp/mysql5.sock",DBUSER,DBPASS,$options);
    return $this->dbconn;
    catch (PDOException $e){ $this->reportDBError($e->getMessage()); }

    For SHARED Hosting at the socket information is not needed and will not work if it IS configured.

    But for people at who have their mysql installed on the same machine as their hosting files and using the socket connection this seems to be the only way to make phpJobScheduler magically appear.

Hope it helps you