php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75612 php-mysqli build fails with MariaDB-10.2
Submitted: 2017-12-01 18:52 UTC Modified: -
Votes:21
Avg. Score:4.3 ± 0.9
Reproduced:19 of 19 (100.0%)
Same Version:9 (47.4%)
Same OS:7 (36.8%)
From: dkasyanov at cloudlinux dot com Assigned:
Status: Open Package: MySQLi related
PHP Version: 7.1.12 OS: Centos 7
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-12-01 18:52 UTC] dkasyanov at cloudlinux dot com
Description:
------------
MariaDB developers have changed mysql headers in 10.2.10+ and now PHP is not compiling.

How to reproduce:
install MariaDB-devel package >= 10.2.10 and run:
./configure --with-mysqli=/usr/bin/mysql_config  CPPFLAGS="-I/usr/include/mysql"
make


Test script:
---------------
Compiled PHP binary


Actual result:
--------------
In file included from /root/php-7.1.12/ext/mysqli/php_mysqli_structs.h:63:0,
                 from /root/php-7.1.12/ext/mysqli/mysqli.c:34:
/usr/include/mysql/my_global.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp]
 #warning This file should not be included by clients, include only <mysql.h>
  ^
In file included from /root/php-7.1.12/ext/mysqli/php_mysqli_structs.h:79:0,
                 from /root/php-7.1.12/ext/mysqli/mysqli.c:34:
/usr/include/mysql/my_sys.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp]
 #warning This file should not be included by clients, include only <mysql.h>
  ^
In file included from /root/php-7.1.12/ext/mysqli/mysqli.c:34:0:
/root/php-7.1.12/ext/mysqli/php_mysqli_structs.h:82:21: fatal error: my_list.h: No such file or directory
 #include <my_list.h>
                     ^
compilation terminated.
make: *** [ext/mysqli/mysqli.lo] Error 1

Patches

mysql-mariadb-10.3.patch (last revision 2018-04-06 20:04 UTC by bero at lindev dot ch)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-04-06 20:06 UTC] bero at lindev dot ch
Same issue here on OpenMandriva with MariaDB 10.3 -- attaching a patch that makes it build and essentially work, but I'm not sure I've handled the removal of st_mysql->reconnect correctly.
 [2018-04-06 22:05 UTC] spam2 at rhsoft dot net
why don't you just build with mysqlnd - IMHO the libmysql stuff should have been removed from php many years ago
 [2018-04-07 20:39 UTC] bero at lindev dot ch
One reason not to use mysqlnd is --enable-embedded-mysqli -- other than that, mysqlnd should do the trick (but needs some testing on our side -- we know libmysql to work from years of using it).
 [2018-04-07 20:43 UTC] spam2 at rhsoft dot net
we use mysqlnd since 2010 everywhere and i don't get why it should be a problem for mysqli - until you configure with shared both are directly in teh binary

[harry@srv-rhsoft:/lib64/php/modules]$ ls | grep mysql
-rwxr-xr-x 1 root root 131K 2018-04-07 19:33 mysqli.so
-rwxr-xr-x 1 root root 290K 2018-04-07 19:33 mysqlnd.so
 [2018-11-28 10:00 UTC] m0r1arty dot nv at yandex dot ru
For temporary solution: after configure open Makefile in root php src directory,look "-I/usr/include/mysql" and replace to "-I/usr/include/mysql/server".
 [2019-05-06 04:36 UTC] phpbugs dot ooglek at 0sg dot net
This is also failing on FreeBSD. I attempted to manually patch 7.3.5 with the changes in the attached patch and compile from source without success.

I have MariaDB 10.2.22 installed.

Process:

1. Checkout git
2. git checkout php-7.3.5
3. ./buildconf --force
4. ./configure --prefix=/usr/local --with-layout=GNU --with-config-file-path=/usr/local/etc --with-config-file-scan-dir=/usr/local/etc/php --mandir=/usr/local/man --infodir=/usr/local/info/ --localstatedir=/var --enable-bcmath --enable-exif --enable-fpm --enable-ftp --enable-intl --enable-libxml --enable-mbstring --enable-mysqlnd --with-mysqli=/usr/local/bin/mysql_config --enable-pcntl --enable-soap --enable-sockets --enable-zip --with-bz2 --with-curl --with-fpm-user=www --with-fpm-group=www --with-freetype-dir=/usr/local --with-gd --with-gettext=/usr/local --with-iconv --with-jpeg-dir=/usr/local --with-libxml-dir=/usr/local --with-openssl --with-pdo-mysql=/usr/local --with-png-dir=/usr/local --with-sodium=/usr/local --with-zlib-dir=/usr --with-zlib=/usr

I get stuff like this

--- ext/mysqli/mysqli_api.lo ---
In file included from /home/human/tmp/php-src/ext/mysqli/mysqli_api.c:32:
In file included from ext/mysqli/php_mysqli_structs.h:61:
/usr/local/include/mysql/my_global.h:3:2: warning: This file should not be included by clients, include only <mysql.h> [-W#warnings]
#warning This file should not be included by clients, include only <mysql.h>
 ^
/home/human/tmp/php-src/ext/mysqli/mysqli_api.c:156:2: warning: format specifies type 'unsigned long' but the argument has type 'my_ulonglong' (aka 'unsigne
d long long') [-Wformat]
        MYSQLI_RETURN_LONG_INT(rc);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~
ext/mysqli/mysqli_priv.h:99:45: note: expanded from macro 'MYSQLI_RETURN_LONG_INT'

In file included from /home/human/tmp/php-src/ext/mysqli/mysqli_api.c:32:
In file included from ext/mysqli/php_mysqli_structs.h:77:
/usr/local/include/mysql/my_sys.h:3:2: warning: This file should not be included by clients, include only <mysql.h> [-W#warnings]
#warning This file should not be included by clients, include only <mysql.h>
 ^
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 18:01:24 2019 UTC