Bug 247859 - databases/php7[2-4]mysqli and databases/php7[2-4]-pdo_mysql: can't connect to mariadb via socket due to changes to the default socket dir
Summary: databases/php7[2-4]mysqli and databases/php7[2-4]-pdo_mysql: can't connect to...
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Torsten Zuehlsdorff
Keywords: needs-qa, regression
Depends on:
Reported: 2020-07-09 00:59 UTC by SBB
Modified: 2020-07-11 21:45 UTC (History)
2 users (show)

See Also:
koobs: maintainer-feedback? (tz)
koobs: maintainer-feedback? (brnrd)
koobs: merge-quarterly?


Note You need to log in before you can comment on or make changes to this bug.
Description SBB 2020-07-09 00:59:43 UTC
Recent changes to mariadb changed the default location of mysql.sock from /tmp/ to /var/run/mysql/ which causes PHP scripts to not be able to connect without manually adding the path in php.ini. See bug #246694 for more info.

It was my understanding that PHP was supposed to be able to automatically figure out the correct location for the socket directory when it's compiled however I've tried reinstalling the php74, php74-mysqli, and php74-pdo_mysql ports via "make install clean" but it still doesn't work.

Is this something that can be fixed via a patch or is the only way to manually go edit the php.ini file on every affected server?
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2020-07-09 01:11:24 UTC

 - Assign to php-* maintainer
 - Request feedback from MariaDB maintainer
Comment 2 Bernard Spil freebsd_committer 2020-07-11 21:45:06 UTC

The default socket path has changed for the ports, but not for existing configurations in /var/db/mysql/my.cnf. Result is that mariadbd uses /var/db/mysql/mysql.sock whereas the client's default installation uses /var/run/mysql/mysql.sock.

This is documented in UPDATING 20200526.

Closing this bug as "Works as intended". I know this affects you and is a POLA violation, but I have to get the MariaDB ports to respect hier(7). Changing the rc(8) script in the 10.4 version to change the default my.cnf felt too breaking to pursue.

If you upgrade to 10.5 this "shoul all work" (TM). I am interested in your experience in non-production environments. (The first GA release is not the one you want to run in production).