jm Posted July 17, 2007 Share Posted July 17, 2007 I just compiled php 5.2.3 and it's trying to connect to mysql with socket /tmp/mysql.sock But the actual socket is /var/run/mysqld/mysqld.sock (as set in my.cnf) . So my php apps (including phpmyadmin) can't find the socket I can temporarily fix this by putting a symlink in /tmp ... "ln –s /var/run/mysqld/mysqld.sock /tmp/mysql.sock" ... everything works until I reboot, then the symlink is deleted - because it's in the temporary directory. I think what I need to do is change the default socket php uses to /var/run/mysqld/mysqld.sock. I tried changing the setting in php.ini (both CLI and Apache2) to: mysql.default.socket = /var/run/mysqld/mysqld.sock But that didn't change anything. Phpinfo still showed: MYSQL_SOCKET = /tmp/mysql.sock Does anybody know what I'm missing. Help really appreciated. James ============ My environment: Ubuntu 6.10 (Edgy) php 5.2.3 (compiled myself: config options: --with-apxs2 --with-openssl=/usr/local/ssl --with-curl –-with-mysql –enable-sockets –enable-soap) mysql 5.0.45 Quote Link to comment Share on other sites More sharing options...
Oldiesmann Posted July 18, 2007 Share Posted July 18, 2007 The setting is mysql.default_socket, not mysql.default.socket. Also, make sure you reboot Apache after making changes to php.ini. Quote Link to comment Share on other sites More sharing options...
jm Posted July 18, 2007 Author Share Posted July 18, 2007 Hi. Thanks for the reply. Sorry, that was my typo: I'm using mysql.default_socket in php.ini. I've also restarted (and rebooted) several times. This is becoming a real pain, because my symlink gets deleted from the tmp directory not just at reboot, but when there's been no activity on mysql for a while. Quote Link to comment Share on other sites More sharing options...
jm Posted August 9, 2007 Author Share Posted August 9, 2007 Solved it! My php.ini file wasn't even being loaded, so the mysql.default_socket wasn't being set to where I wanted. I set the PHPRC environment variable to PHPRC=/etc/php5/apache2 .... and everything now works. (I'm on Ubuntu, so did this in /etc/init.d/apache2). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.