summary refs log tree commit diff
path: root/pkgs/development/interpreters
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2018-09-23 14:55:34 +0200
committerFlorian Klink <flokli@flokli.de>2018-09-23 15:08:39 +0200
commitbaa04e4204b80225c5086611f305a0c412dc9967 (patch)
treee6727c316736831fb78964a69d7e86e19e00e810 /pkgs/development/interpreters
parent93408aecc4accc158293222ccbbfe15283da70e0 (diff)
downloadnixpkgs-baa04e4204b80225c5086611f305a0c412dc9967.tar
nixpkgs-baa04e4204b80225c5086611f305a0c412dc9967.tar.gz
nixpkgs-baa04e4204b80225c5086611f305a0c412dc9967.tar.bz2
nixpkgs-baa04e4204b80225c5086611f305a0c412dc9967.tar.lz
nixpkgs-baa04e4204b80225c5086611f305a0c412dc9967.tar.xz
nixpkgs-baa04e4204b80225c5086611f305a0c412dc9967.tar.zst
nixpkgs-baa04e4204b80225c5086611f305a0c412dc9967.zip
php: set mysql socket path if mysql[i] or pdo_mysql support is enabled
PHP tries to discover the mysql default socket path during configure
phase by probing the file system:
https://github.com/php/php-src/blob/cf3b852109a88a11370d0207cd3b72a53b6a64c3/ext/mysqli/config.m4#L4

This obviously fails to discover /run/mysqld/mysqld.sock, which is being
used (hardcoded) across all MySQL flavours.

This leads to PHP having no mysql socket path set for the mysql[i]
extensions, and `/tmp/mysql.sock` set for pdo_mysql,
meaning one currently has to manually configure and set it in php.ini.

Luckily, PHP supports setting that path via
`--with-mysql-sock=/run/mysqld/mysqld.sock` during configure phase,
so let's do this as soon as one of the three modules is enabled.
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r--pkgs/development/interpreters/php/default.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix
index adffe647c36..9fa3b96fd34 100644
--- a/pkgs/development/interpreters/php/default.nix
+++ b/pkgs/development/interpreters/php/default.nix
@@ -136,6 +136,7 @@ let
       ++ optionals mysqliSupport [
         "--with-mysqli=${if mysqlndSupport then "mysqlnd" else "${mysql.connector-c}/bin/mysql_config"}"
       ]
+      ++ optional ( pdo_mysqlSupport || mysqlSupport || mysqliSupport ) "--with-mysql-sock=/run/mysqld/mysqld.sock"
       ++ optional bcmathSupport "--enable-bcmath"
       # FIXME: Our own gd package doesn't work, see https://bugs.php.net/bug.php?id=60108.
       ++ optionals gdSupport [