Image

Imagehipmaestro wrote in Imagephp

Related Question

OK, new question, related to the last. The default socket was '/tmp/mysql.sock', which doesn't exist. The weird thing was, that works unless the PHP file is run as CGI.

So my hypothesis is that when a php file is run by the apache module instead of CGI, apache creates a temporary symlink at '/tmp/mysql.sock', pointing at the real one. I got it working by finding the location of the real socket, and setting the 'mysql.default_socket' to point there instead of in '/tmp':

ini_set('mysql.default_socket', '/var/lib/mysql/mysql.sock');

Is my hypothesis correct? Is my solution a bad idea?