FS#17930 - [php] mysql socket must be explicitly provided in php.ini after update
Attached to Project:
Arch Linux
Opened by Mårten Olsson (maos) - Wednesday, 20 January 2010, 21:04 GMT
Last edited by Pierre Schmitz (Pierre) - Wednesday, 03 February 2010, 23:54 GMT
Opened by Mårten Olsson (maos) - Wednesday, 20 January 2010, 21:04 GMT
Last edited by Pierre Schmitz (Pierre) - Wednesday, 03 February 2010, 23:54 GMT
|
Details
Description:
After upgrading to php-5.3.1-4 and php-apache-5.3.1-4 I must explicitly provide the local socket in php.ini to be able to use mysql from php in apache. Must add these in php.ini: mysql.default_socket = /var/run/mysqld/mysqld.sock mysqli.default_socket = /var/run/mysqld/mysqld.sock Example: without having local socket in php.ini then phpmyadmin gives error "#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured) " Adding the two lines above or downgrading to php-5.3.1-3 and php-apache-5.3.1-3 makes it work again Additional info: * package version(s) php-5.3.1-4/php-apache-5.3.1-4 * config and/or log files etc. Adding the two lines above to php.ini solves it Steps to reproduce: 1. make sure that nothing is set in mysql.default_socket and mysqli.default_socket and php-5.3.1-3 and php-apache-5.3.1-3 2 verify that php can use mysql 3. upgrade to php-5.3.1-4 and php-apache-5.3.1-4 4. restart apache 5. .... php access to mysql doesn't work 6. add mysql.default_socket = /var/run/mysqld/mysqld.sock and mysqli.default_socket = /var/run/mysqld/mysqld.sock at appropriate lines 7. restart apache again 8. and access to mysql works again |
This task depends upon
In my.cnf the socket is set to /var/run/mysqld/mysqld.sock both in client and server section
So I don't understand what is wrong.
PHP Warning: mysql_connect(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock)
Added in php.ini:
mysql.default_socket = /var/run/mysqld/mysqld.sock
- works.
See my attempts with the mysql and pdo_mysql extensions at http://omploader.org/vM2YzMA
I've rebuilt php 5.3.1-4 with revision 60021 ("use upstream patch") [1] reverted and it now works on two machines that the official package didn't. I'm not able to pinpoint the reason why the upstream patch wouldn't work, but since php 5.3.2 (I tested RC1) will have this fixed reverting to "our" mysqlnd.patch might be a good solution.
----
[1] http://repos.archlinux.org/wsvn/packages/php/trunk/?op=revision&rev=60021
Adding "mysql.default_socket = /var/run/mysqld/mysqld.sock" to php.ini solves the problem.