Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-14555

PHP mysqli extension cannot be build with MariaDB >= 10.2.10

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Done
    • 10.2.8, 10.2.11, 10.2.12
    • N/A
    • N/A
    • Centos 7 + MariaDB-devel 10.2.11 + PHP 7.1.12

    Description

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

      Expected result:
      Complied PHP binary with mysqli extension:

      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
      

      Attachments

        Activity

          my_list.h is now installed under include/mysql/server.

          commit 3ec96c18244b448b2adf30deb856e34907c12326
          Author: Sergei Golubchik <serg@mariadb.org>
          Date:   Wed Aug 9 20:35:33 2017 +0200
           
              MDEV-13370 Ambiguous behaviour regarding installation of header files
              
              install all server includes under /usr/include/mysql/server/
              and C/C includes under /usr/include/mysql/
          

          elenst Elena Stepanova added a comment - my_list.h is now installed under include/mysql/server. commit 3ec96c18244b448b2adf30deb856e34907c12326 Author: Sergei Golubchik <serg@mariadb.org> Date: Wed Aug 9 20:35:33 2017 +0200   MDEV-13370 Ambiguous behaviour regarding installation of header files install all server includes under /usr/include/mysql/server/ and C/C includes under /usr/include/mysql/

          Centos 7 + MariaDB-10.2.12 + PHP 7.2.1:
          ./configure --with-mysqli=shared,/usr/bin/mysql_config CPPFLAGS="-I/usr/include/mysql" && make

          /bin/sh /root/php-7.2.1/libtool --silent --preserve-dup-deps --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/mysqli/ -I/root/php-7.2.1/ext/mysqli/ -DPHP_ATOM_INC -I/root/php-7.2.1/include -I/root/php-7.2.1/main -I/root/php-7.2.1 -I/root/php-7.2.1/ext/date/lib -I/usr/include/libxml2 -I/usr/include/mysql -I/usr/include/mysql/mysql -I/root/php-7.2.1/ext/sqlite3/libsqlite -I/root/php-7.2.1/TSRM -I/root/php-7.2.1/Zend  -I/usr/include/mysql  -I/usr/include -g -O2 -fvisibility=hidden -DZEND_SIGNALS    -c /root/php-7.2.1/ext/mysqli/mysqli.c -o ext/mysqli/mysqli.lo 
          In file included from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:63:0,
                           from /root/php-7.2.1/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.2.1/ext/mysqli/php_mysqli_structs.h:79:0,
                           from /root/php-7.2.1/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.2.1/ext/mysqli/mysqli.c:34:0:
          /root/php-7.2.1/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
          

          ./configure --with-mysqli=shared,/usr/bin/mysql_config CPPFLAGS="-I/usr/include/mysql/server" && make

          /bin/sh /root/php-7.2.1/libtool --silent --preserve-dup-deps --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/mysqli/ -I/root/php-7.2.1/ext/mysqli/ -DPHP_ATOM_INC -I/root/php-7.2.1/include -I/root/php-7.2.1/main -I/root/php-7.2.1 -I/root/php-7.2.1/ext/date/lib -I/usr/include/libxml2 -I/usr/include/mysql -I/usr/include/mysql/mysql -I/root/php-7.2.1/ext/sqlite3/libsqlite -I/root/php-7.2.1/TSRM -I/root/php-7.2.1/Zend  -I/usr/include/mysql/server  -I/usr/include -g -O2 -fvisibility=hidden -DZEND_SIGNALS    -c /root/php-7.2.1/ext/mysqli/mysqli.c -o ext/mysqli/mysqli.lo 
          In file included from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:63:0,
                           from /root/php-7.2.1/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.2.1/ext/mysqli/php_mysqli_structs.h:79:0,
                           from /root/php-7.2.1/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 /usr/include/mysql/server/my_global.h:75:0,
                           from /usr/include/mysql/server/m_string.h:25,
                           from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:83,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/my_config.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 /usr/include/mysql/server/my_compiler.h:27:0,
                           from /usr/include/mysql/server/my_global.h:491,
                           from /usr/include/mysql/server/m_string.h:25,
                           from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:83,
                           from /root/php-7.2.1/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 /usr/include/mysql/server/m_string.h:25:0,
                           from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:83,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/server/my_global.h:560:1: error: unknown type name ‘SOCKET_SIZE_TYPE’
           typedef SOCKET_SIZE_TYPE size_socket;
           ^
          /usr/include/mysql/server/my_global.h:745:2: error: #error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS"
           #error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS"
            ^
          /usr/include/mysql/server/my_global.h:817:0: warning: "isnan" redefined [enabled by default]
           #define isnan(x) ((x) != (x))
           ^
          In file included from /root/php-7.2.1/include/../main/php_config.h:2587:0,
                           from /root/php-7.2.1/Zend/zend_config.h:1,
                           from /root/php-7.2.1/Zend/zend_portability.h:45,
                           from /root/php-7.2.1/Zend/zend_types.h:27,
                           from /root/php-7.2.1/Zend/zend.h:29,
                           from /root/php-7.2.1/main/php.h:35,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:29:
          /usr/include/math.h:254:0: note: this is the location of the previous definition
           #  define isnan(x) \
           ^
          In file included from /usr/include/mysql/server/m_string.h:25:0,
                           from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:83,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/server/my_global.h:843:22: error: static declaration of ‘log2’ follows non-static declaration
           static inline double log2(double x)
                                ^
          /usr/include/mysql/server/my_global.h:970:2: error: #error sizeof(void *) is neither sizeof(int) nor sizeof(long) nor sizeof(long long)
           #error sizeof(void *) is neither sizeof(int) nor sizeof(long) nor sizeof(long long)
            ^
          In file included from /usr/include/mysql/server/mysql/service_thd_timezone.h:41:0,
                           from /usr/include/mysql/server/mysql/services.h:40,
                           from /usr/include/mysql/server/mysql/plugin.h:51,
                           from /usr/include/mysql/server/my_global.h:1021,
                           from /usr/include/mysql/server/m_string.h:25,
                           from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:83,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/server/mysql_time.h:40:6: error: nested redefinition of ‘enum enum_mysql_timestamp_type’
           enum enum_mysql_timestamp_type
                ^
          /usr/include/mysql/server/mysql_time.h:40:6: error: redeclaration of ‘enum enum_mysql_timestamp_type’
          In file included from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:80:0,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/mysql.h:383:6: note: originally defined here
           enum enum_mysql_timestamp_type
                ^
          In file included from /usr/include/mysql/server/mysql/service_thd_timezone.h:41:0,
                           from /usr/include/mysql/server/mysql/services.h:40,
                           from /usr/include/mysql/server/mysql/plugin.h:51,
                           from /usr/include/mysql/server/my_global.h:1021,
                           from /usr/include/mysql/server/m_string.h:25,
                           from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:83,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/server/mysql_time.h:42:3: error: redeclaration of enumerator ‘MYSQL_TIMESTAMP_NONE’
             MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1,
             ^
          In file included from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:80:0,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/mysql.h:385:3: note: previous definition of ‘MYSQL_TIMESTAMP_NONE’ was here
             MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1,
             ^
          In file included from /usr/include/mysql/server/mysql/service_thd_timezone.h:41:0,
                           from /usr/include/mysql/server/mysql/services.h:40,
                           from /usr/include/mysql/server/mysql/plugin.h:51,
                           from /usr/include/mysql/server/my_global.h:1021,
                           from /usr/include/mysql/server/m_string.h:25,
                           from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:83,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/server/mysql_time.h:42:29: error: redeclaration of enumerator ‘MYSQL_TIMESTAMP_ERROR’
             MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1,
                                       ^
          In file included from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:80:0,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/mysql.h:385:29: note: previous definition of ‘MYSQL_TIMESTAMP_ERROR’ was here
             MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1,
                                       ^
          In file included from /usr/include/mysql/server/mysql/service_thd_timezone.h:41:0,
                           from /usr/include/mysql/server/mysql/services.h:40,
                           from /usr/include/mysql/server/mysql/plugin.h:51,
                           from /usr/include/mysql/server/my_global.h:1021,
                           from /usr/include/mysql/server/m_string.h:25,
                           from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:83,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/server/mysql_time.h:43:3: error: redeclaration of enumerator ‘MYSQL_TIMESTAMP_DATE’
             MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2
             ^
          In file included from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:80:0,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/mysql.h:386:3: note: previous definition of ‘MYSQL_TIMESTAMP_DATE’ was here
             MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2
             ^
          In file included from /usr/include/mysql/server/mysql/service_thd_timezone.h:41:0,
                           from /usr/include/mysql/server/mysql/services.h:40,
                           from /usr/include/mysql/server/mysql/plugin.h:51,
                           from /usr/include/mysql/server/my_global.h:1021,
                           from /usr/include/mysql/server/m_string.h:25,
                           from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:83,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/server/mysql_time.h:43:28: error: redeclaration of enumerator ‘MYSQL_TIMESTAMP_DATETIME’
             MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2
                                      ^
          In file included from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:80:0,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/mysql.h:386:28: note: previous definition of ‘MYSQL_TIMESTAMP_DATETIME’ was here
             MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2
                                      ^
          In file included from /usr/include/mysql/server/mysql/service_thd_timezone.h:41:0,
                           from /usr/include/mysql/server/mysql/services.h:40,
                           from /usr/include/mysql/server/mysql/plugin.h:51,
                           from /usr/include/mysql/server/my_global.h:1021,
                           from /usr/include/mysql/server/m_string.h:25,
                           from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:83,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/server/mysql_time.h:43:57: error: redeclaration of enumerator ‘MYSQL_TIMESTAMP_TIME’
             MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2
                                                                   ^
          In file included from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:80:0,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/mysql.h:386:57: note: previous definition of ‘MYSQL_TIMESTAMP_TIME’ was here
             MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2
                                                                   ^
          In file included from /usr/include/mysql/server/mysql/service_thd_timezone.h:41:0,
                           from /usr/include/mysql/server/mysql/services.h:40,
                           from /usr/include/mysql/server/mysql/plugin.h:51,
                           from /usr/include/mysql/server/my_global.h:1021,
                           from /usr/include/mysql/server/m_string.h:25,
                           from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:83,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/server/mysql_time.h:59:16: error: redefinition of ‘struct st_mysql_time’
           typedef struct st_mysql_time
                          ^
          In file included from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:80:0,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/mysql.h:389:16: note: originally defined here
           typedef struct st_mysql_time
                          ^
          In file included from /usr/include/mysql/server/mysql/service_thd_timezone.h:41:0,
                           from /usr/include/mysql/server/mysql/services.h:40,
                           from /usr/include/mysql/server/mysql/plugin.h:51,
                           from /usr/include/mysql/server/my_global.h:1021,
                           from /usr/include/mysql/server/m_string.h:25,
                           from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:83,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/server/mysql_time.h:65:3: error: conflicting types for ‘MYSQL_TIME’
           } MYSQL_TIME;
             ^
          In file included from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:80:0,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/mysql.h:395:3: note: previous declaration of ‘MYSQL_TIME’ was here
           } MYSQL_TIME;
             ^
          In file included from /usr/include/mysql/server/m_string.h:25:0,
                           from /root/php-7.2.1/ext/mysqli/php_mysqli_structs.h:83,
                           from /root/php-7.2.1/ext/mysqli/mysqli.c:34:
          /usr/include/mysql/server/my_global.h:1181:22: error: static declaration of ‘rint’ follows non-static declaration
           static inline double rint(double x)
                                ^
          /root/php-7.2.1/ext/mysqli/mysqli.c: In function ‘zm_info_mysqli’:
          /root/php-7.2.1/ext/mysqli/mysqli.c:988:59: error: ‘MYSQL_SERVER_VERSION’ undeclared (first use in this function)
            php_info_print_table_row(2, "Client API header version", MYSQL_SERVER_VERSION);
                                                                     ^
          /root/php-7.2.1/ext/mysqli/mysqli.c:988:59: note: each undeclared identifier is reported only once for each function it appears in
          /root/php-7.2.1/ext/mysqli/mysqli.c:989:47: error: ‘MYSQL_UNIX_ADDR’ undeclared (first use in this function)
            php_info_print_table_row(2, "MYSQLI_SOCKET", MYSQL_UNIX_ADDR);
                                                         ^
          make: *** [ext/mysqli/mysqli.lo] Error 1
          
          

          dkasyanov Dmitriy Kasyanov (Inactive) added a comment - Centos 7 + MariaDB-10.2.12 + PHP 7.2.1: ./configure --with-mysqli=shared,/usr/bin/mysql_config CPPFLAGS="-I/usr/include/mysql" && make /bin/sh /root/php- 7.2 . 1 /libtool --silent --preserve-dup-deps --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE= 1 -Iext/mysqli/ -I/root/php- 7.2 . 1 /ext/mysqli/ -DPHP_ATOM_INC -I/root/php- 7.2 . 1 /include -I/root/php- 7.2 . 1 /main -I/root/php- 7.2 . 1 -I/root/php- 7.2 . 1 /ext/date/lib -I/usr/include/libxml2 -I/usr/include/mysql -I/usr/include/mysql/mysql -I/root/php- 7.2 . 1 /ext/sqlite3/libsqlite -I/root/php- 7.2 . 1 /TSRM -I/root/php- 7.2 . 1 /Zend -I/usr/include/mysql -I/usr/include -g -O2 -fvisibility=hidden -DZEND_SIGNALS -c /root/php- 7.2 . 1 /ext/mysqli/mysqli.c -o ext/mysqli/mysqli.lo In file included from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 63 : 0 , from /root/php- 7.2 . 1 /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.2 . 1 /ext/mysqli/php_mysqli_structs.h: 79 : 0 , from /root/php- 7.2 . 1 /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.2 . 1 /ext/mysqli/mysqli.c: 34 : 0 : /root/php- 7.2 . 1 /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 ./configure --with-mysqli=shared,/usr/bin/mysql_config CPPFLAGS="-I/usr/include/mysql/server" && make /bin/sh /root/php- 7.2 . 1 /libtool --silent --preserve-dup-deps --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE= 1 -Iext/mysqli/ -I/root/php- 7.2 . 1 /ext/mysqli/ -DPHP_ATOM_INC -I/root/php- 7.2 . 1 /include -I/root/php- 7.2 . 1 /main -I/root/php- 7.2 . 1 -I/root/php- 7.2 . 1 /ext/date/lib -I/usr/include/libxml2 -I/usr/include/mysql -I/usr/include/mysql/mysql -I/root/php- 7.2 . 1 /ext/sqlite3/libsqlite -I/root/php- 7.2 . 1 /TSRM -I/root/php- 7.2 . 1 /Zend -I/usr/include/mysql/server -I/usr/include -g -O2 -fvisibility=hidden -DZEND_SIGNALS -c /root/php- 7.2 . 1 /ext/mysqli/mysqli.c -o ext/mysqli/mysqli.lo In file included from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 63 : 0 , from /root/php- 7.2 . 1 /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.2 . 1 /ext/mysqli/php_mysqli_structs.h: 79 : 0 , from /root/php- 7.2 . 1 /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 /usr/include/mysql/server/my_global.h: 75 : 0 , from /usr/include/mysql/server/m_string.h: 25 , from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 83 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/my_config.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 /usr/include/mysql/server/my_compiler.h: 27 : 0 , from /usr/include/mysql/server/my_global.h: 491 , from /usr/include/mysql/server/m_string.h: 25 , from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 83 , from /root/php- 7.2 . 1 /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 /usr/include/mysql/server/m_string.h: 25 : 0 , from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 83 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/server/my_global.h: 560 : 1 : error: unknown type name ‘SOCKET_SIZE_TYPE’ typedef SOCKET_SIZE_TYPE size_socket; ^ /usr/include/mysql/server/my_global.h: 745 : 2 : error: #error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS" #error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS" ^ /usr/include/mysql/server/my_global.h: 817 : 0 : warning: "isnan" redefined [enabled by default ] #define isnan(x) ((x) != (x)) ^ In file included from /root/php- 7.2 . 1 /include/../main/php_config.h: 2587 : 0 , from /root/php- 7.2 . 1 /Zend/zend_config.h: 1 , from /root/php- 7.2 . 1 /Zend/zend_portability.h: 45 , from /root/php- 7.2 . 1 /Zend/zend_types.h: 27 , from /root/php- 7.2 . 1 /Zend/zend.h: 29 , from /root/php- 7.2 . 1 /main/php.h: 35 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 29 : /usr/include/math.h: 254 : 0 : note: this is the location of the previous definition # define isnan(x) \ ^ In file included from /usr/include/mysql/server/m_string.h: 25 : 0 , from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 83 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/server/my_global.h: 843 : 22 : error: static declaration of ‘log2’ follows non- static declaration static inline double log2( double x) ^ /usr/include/mysql/server/my_global.h: 970 : 2 : error: #error sizeof( void *) is neither sizeof( int ) nor sizeof( long ) nor sizeof( long long ) #error sizeof( void *) is neither sizeof( int ) nor sizeof( long ) nor sizeof( long long ) ^ In file included from /usr/include/mysql/server/mysql/service_thd_timezone.h: 41 : 0 , from /usr/include/mysql/server/mysql/services.h: 40 , from /usr/include/mysql/server/mysql/plugin.h: 51 , from /usr/include/mysql/server/my_global.h: 1021 , from /usr/include/mysql/server/m_string.h: 25 , from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 83 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/server/mysql_time.h: 40 : 6 : error: nested redefinition of ‘ enum enum_mysql_timestamp_type’ enum enum_mysql_timestamp_type ^ /usr/include/mysql/server/mysql_time.h: 40 : 6 : error: redeclaration of ‘ enum enum_mysql_timestamp_type’ In file included from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 80 : 0 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/mysql.h: 383 : 6 : note: originally defined here enum enum_mysql_timestamp_type ^ In file included from /usr/include/mysql/server/mysql/service_thd_timezone.h: 41 : 0 , from /usr/include/mysql/server/mysql/services.h: 40 , from /usr/include/mysql/server/mysql/plugin.h: 51 , from /usr/include/mysql/server/my_global.h: 1021 , from /usr/include/mysql/server/m_string.h: 25 , from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 83 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/server/mysql_time.h: 42 : 3 : error: redeclaration of enumerator ‘MYSQL_TIMESTAMP_NONE’ MYSQL_TIMESTAMP_NONE= - 2 , MYSQL_TIMESTAMP_ERROR= - 1 , ^ In file included from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 80 : 0 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/mysql.h: 385 : 3 : note: previous definition of ‘MYSQL_TIMESTAMP_NONE’ was here MYSQL_TIMESTAMP_NONE= - 2 , MYSQL_TIMESTAMP_ERROR= - 1 , ^ In file included from /usr/include/mysql/server/mysql/service_thd_timezone.h: 41 : 0 , from /usr/include/mysql/server/mysql/services.h: 40 , from /usr/include/mysql/server/mysql/plugin.h: 51 , from /usr/include/mysql/server/my_global.h: 1021 , from /usr/include/mysql/server/m_string.h: 25 , from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 83 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/server/mysql_time.h: 42 : 29 : error: redeclaration of enumerator ‘MYSQL_TIMESTAMP_ERROR’ MYSQL_TIMESTAMP_NONE= - 2 , MYSQL_TIMESTAMP_ERROR= - 1 , ^ In file included from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 80 : 0 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/mysql.h: 385 : 29 : note: previous definition of ‘MYSQL_TIMESTAMP_ERROR’ was here MYSQL_TIMESTAMP_NONE= - 2 , MYSQL_TIMESTAMP_ERROR= - 1 , ^ In file included from /usr/include/mysql/server/mysql/service_thd_timezone.h: 41 : 0 , from /usr/include/mysql/server/mysql/services.h: 40 , from /usr/include/mysql/server/mysql/plugin.h: 51 , from /usr/include/mysql/server/my_global.h: 1021 , from /usr/include/mysql/server/m_string.h: 25 , from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 83 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/server/mysql_time.h: 43 : 3 : error: redeclaration of enumerator ‘MYSQL_TIMESTAMP_DATE’ MYSQL_TIMESTAMP_DATE= 0 , MYSQL_TIMESTAMP_DATETIME= 1 , MYSQL_TIMESTAMP_TIME= 2 ^ In file included from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 80 : 0 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/mysql.h: 386 : 3 : note: previous definition of ‘MYSQL_TIMESTAMP_DATE’ was here MYSQL_TIMESTAMP_DATE= 0 , MYSQL_TIMESTAMP_DATETIME= 1 , MYSQL_TIMESTAMP_TIME= 2 ^ In file included from /usr/include/mysql/server/mysql/service_thd_timezone.h: 41 : 0 , from /usr/include/mysql/server/mysql/services.h: 40 , from /usr/include/mysql/server/mysql/plugin.h: 51 , from /usr/include/mysql/server/my_global.h: 1021 , from /usr/include/mysql/server/m_string.h: 25 , from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 83 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/server/mysql_time.h: 43 : 28 : error: redeclaration of enumerator ‘MYSQL_TIMESTAMP_DATETIME’ MYSQL_TIMESTAMP_DATE= 0 , MYSQL_TIMESTAMP_DATETIME= 1 , MYSQL_TIMESTAMP_TIME= 2 ^ In file included from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 80 : 0 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/mysql.h: 386 : 28 : note: previous definition of ‘MYSQL_TIMESTAMP_DATETIME’ was here MYSQL_TIMESTAMP_DATE= 0 , MYSQL_TIMESTAMP_DATETIME= 1 , MYSQL_TIMESTAMP_TIME= 2 ^ In file included from /usr/include/mysql/server/mysql/service_thd_timezone.h: 41 : 0 , from /usr/include/mysql/server/mysql/services.h: 40 , from /usr/include/mysql/server/mysql/plugin.h: 51 , from /usr/include/mysql/server/my_global.h: 1021 , from /usr/include/mysql/server/m_string.h: 25 , from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 83 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/server/mysql_time.h: 43 : 57 : error: redeclaration of enumerator ‘MYSQL_TIMESTAMP_TIME’ MYSQL_TIMESTAMP_DATE= 0 , MYSQL_TIMESTAMP_DATETIME= 1 , MYSQL_TIMESTAMP_TIME= 2 ^ In file included from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 80 : 0 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/mysql.h: 386 : 57 : note: previous definition of ‘MYSQL_TIMESTAMP_TIME’ was here MYSQL_TIMESTAMP_DATE= 0 , MYSQL_TIMESTAMP_DATETIME= 1 , MYSQL_TIMESTAMP_TIME= 2 ^ In file included from /usr/include/mysql/server/mysql/service_thd_timezone.h: 41 : 0 , from /usr/include/mysql/server/mysql/services.h: 40 , from /usr/include/mysql/server/mysql/plugin.h: 51 , from /usr/include/mysql/server/my_global.h: 1021 , from /usr/include/mysql/server/m_string.h: 25 , from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 83 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/server/mysql_time.h: 59 : 16 : error: redefinition of ‘struct st_mysql_time’ typedef struct st_mysql_time ^ In file included from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 80 : 0 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/mysql.h: 389 : 16 : note: originally defined here typedef struct st_mysql_time ^ In file included from /usr/include/mysql/server/mysql/service_thd_timezone.h: 41 : 0 , from /usr/include/mysql/server/mysql/services.h: 40 , from /usr/include/mysql/server/mysql/plugin.h: 51 , from /usr/include/mysql/server/my_global.h: 1021 , from /usr/include/mysql/server/m_string.h: 25 , from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 83 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/server/mysql_time.h: 65 : 3 : error: conflicting types for ‘MYSQL_TIME’ } MYSQL_TIME; ^ In file included from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 80 : 0 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/mysql.h: 395 : 3 : note: previous declaration of ‘MYSQL_TIME’ was here } MYSQL_TIME; ^ In file included from /usr/include/mysql/server/m_string.h: 25 : 0 , from /root/php- 7.2 . 1 /ext/mysqli/php_mysqli_structs.h: 83 , from /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 34 : /usr/include/mysql/server/my_global.h: 1181 : 22 : error: static declaration of ‘rint’ follows non- static declaration static inline double rint( double x) ^ /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: In function ‘zm_info_mysqli’: /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 988 : 59 : error: ‘MYSQL_SERVER_VERSION’ undeclared (first use in this function) php_info_print_table_row( 2 , "Client API header version" , MYSQL_SERVER_VERSION); ^ /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 988 : 59 : note: each undeclared identifier is reported only once for each function it appears in /root/php- 7.2 . 1 /ext/mysqli/mysqli.c: 989 : 47 : error: ‘MYSQL_UNIX_ADDR’ undeclared (first use in this function) php_info_print_table_row( 2 , "MYSQLI_SOCKET" , MYSQL_UNIX_ADDR); ^ make: *** [ext/mysqli/mysqli.lo] Error 1
          stephaneeybert Stephane Eybert added a comment - - edited

          elenst
          So the command

          ./configure --with-mysqli=/usr/bin/mysql_config CPPFLAGS="-I/usr/include/mysql"
          

          should be replaced by another one ? If so, which path to pass in then ?
          I'm on MariaDB 10.3.7

          stephaneeybert Stephane Eybert added a comment - - edited elenst So the command ./configure --with-mysqli=/usr/bin/mysql_config CPPFLAGS= "-I/usr/include/mysql" should be replaced by another one ? If so, which path to pass in then ? I'm on MariaDB 10.3.7

          I also tried with MariaDB 10.3.12 and got the same error.

          For the record, here is my error:

          In file included from /usr/bin/php-7.3.2/ext/mysqli/php_mysqli_structs.h:61:0,
                           from /usr/bin/php-7.3.2/ext/mysqli/mysqli.c:32:
          /usr/bin/mariadb/install/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 /usr/bin/php-7.3.2/ext/mysqli/php_mysqli_structs.h:77:0,
                           from /usr/bin/php-7.3.2/ext/mysqli/mysqli.c:32:
          /usr/bin/mariadb/install/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 /usr/bin/php-7.3.2/ext/mysqli/mysqli.c:32:0:
          /usr/bin/php-7.3.2/ext/mysqli/php_mysqli_structs.h:80:10: fatal error: my_list.h: No such file or directory
           #include <my_list.h>
                    ^~~~~~~~~~~
          compilation terminated.
          make: *** [ext/mysqli/mysqli.lo] Error 1
          

          stephaneeybert Stephane Eybert added a comment - I also tried with MariaDB 10.3.12 and got the same error. For the record, here is my error: In file included from /usr/bin/php- 7.3 . 2 /ext/mysqli/php_mysqli_structs.h: 61 : 0 , from /usr/bin/php- 7.3 . 2 /ext/mysqli/mysqli.c: 32 : /usr/bin/mariadb/install/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 /usr/bin/php- 7.3 . 2 /ext/mysqli/php_mysqli_structs.h: 77 : 0 , from /usr/bin/php- 7.3 . 2 /ext/mysqli/mysqli.c: 32 : /usr/bin/mariadb/install/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 /usr/bin/php- 7.3 . 2 /ext/mysqli/mysqli.c: 32 : 0 : /usr/bin/php- 7.3 . 2 /ext/mysqli/php_mysqli_structs.h: 80 : 10 : fatal error: my_list.h: No such file or directory #include <my_list.h> ^~~~~~~~~~~ compilation terminated. make: *** [ext/mysqli/mysqli.lo] Error 1

          Setting the environment variable:

          CPPFLAGS="-I/usr/bin/mariadb/install/include/mysql/server/"
          

          didn't help and the error remained the same:

          root@119179b7781d:/usr/bin/php# CPPFLAGS="-I/usr/bin/mariadb/install/include/mysql/server/"
          root@119179b7781d:/usr/bin/php# make
          /bin/bash /usr/bin/php/libtool --silent --preserve-dup-deps --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/mysqli/ -I/usr/bin/php/ext/mysqli/ -DPHP_ATOM_INC -I/usr/bin/php/include -I/usr/bin/php/main -I/usr/bin/php -I/usr/bin/php/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/bin/php/ext/mbstring/oniguruma -I/usr/bin/php/ext/mbstring/libmbfl -I/usr/bin/php/ext/mbstring/libmbfl/mbfl -I/usr/bin/mariadb/install/include/mysql -I/usr/bin/mariadb/install/include/mysql/mysql -I/usr/bin/php/ext/sqlite3/libsqlite -I/usr/bin/php/TSRM -I/usr/bin/php/Zend  -D_REENTRANT -pthread  -I/usr/include -g -O2 -fvisibility=hidden -pthread -DZTS -DZEND_SIGNALS   -c /usr/bin/php/ext/mysqli/mysqli.c -o ext/mysqli/mysqli.lo 
          In file included from /usr/bin/php/ext/mysqli/php_mysqli_structs.h:61:0,
                           from /usr/bin/php/ext/mysqli/mysqli.c:32:
          /usr/bin/mariadb/install/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 /usr/bin/php/ext/mysqli/php_mysqli_structs.h:77:0,
                           from /usr/bin/php/ext/mysqli/mysqli.c:32:
          /usr/bin/mariadb/install/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 /usr/bin/php/ext/mysqli/mysqli.c:32:0:
          /usr/bin/php/ext/mysqli/php_mysqli_structs.h:80:10: fatal error: my_list.h: No such file or directory
           #include <my_list.h>
          

          Same for:

          CFLAGS="-I/usr/bin/mariadb/install/include/mysql/server/"
          

          My MariaDB is to be found in:

            --with-mysqli=/usr/bin/mariadb/install/bin/mysql_config \
            --with-pdo-mysql=/usr/bin/mariadb/install/ \
          

          How to specify that path to the header files prior to running the make command ?

          stephaneeybert Stephane Eybert added a comment - Setting the environment variable: CPPFLAGS= "-I/usr/bin/mariadb/install/include/mysql/server/" didn't help and the error remained the same: root @119179b7781d :/usr/bin/php# CPPFLAGS= "-I/usr/bin/mariadb/install/include/mysql/server/" root @119179b7781d :/usr/bin/php# make /bin/bash /usr/bin/php/libtool --silent --preserve-dup-deps --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE= 1 -Iext/mysqli/ -I/usr/bin/php/ext/mysqli/ -DPHP_ATOM_INC -I/usr/bin/php/include -I/usr/bin/php/main -I/usr/bin/php -I/usr/bin/php/ext/date/lib -I/usr/include/libxml2 -I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/bin/php/ext/mbstring/oniguruma -I/usr/bin/php/ext/mbstring/libmbfl -I/usr/bin/php/ext/mbstring/libmbfl/mbfl -I/usr/bin/mariadb/install/include/mysql -I/usr/bin/mariadb/install/include/mysql/mysql -I/usr/bin/php/ext/sqlite3/libsqlite -I/usr/bin/php/TSRM -I/usr/bin/php/Zend -D_REENTRANT -pthread -I/usr/include -g -O2 -fvisibility=hidden -pthread -DZTS -DZEND_SIGNALS -c /usr/bin/php/ext/mysqli/mysqli.c -o ext/mysqli/mysqli.lo In file included from /usr/bin/php/ext/mysqli/php_mysqli_structs.h: 61 : 0 , from /usr/bin/php/ext/mysqli/mysqli.c: 32 : /usr/bin/mariadb/install/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 /usr/bin/php/ext/mysqli/php_mysqli_structs.h: 77 : 0 , from /usr/bin/php/ext/mysqli/mysqli.c: 32 : /usr/bin/mariadb/install/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 /usr/bin/php/ext/mysqli/mysqli.c: 32 : 0 : /usr/bin/php/ext/mysqli/php_mysqli_structs.h: 80 : 10 : fatal error: my_list.h: No such file or directory #include <my_list.h> Same for: CFLAGS= "-I/usr/bin/mariadb/install/include/mysql/server/" My MariaDB is to be found in: --with-mysqli=/usr/bin/mariadb/install/bin/mysql_config \ --with-pdo-mysql=/usr/bin/mariadb/install/ \ How to specify that path to the header files prior to running the make command ?
          danblack Daniel Black added a comment -

          This was fixed upstream - https://github.com/php/php-src/pull/6127

          I just tested again on php 8.1.3 and it works.

          But mysqli has removed support for external libraries in 8.2.0

          danblack Daniel Black added a comment - This was fixed upstream - https://github.com/php/php-src/pull/6127 I just tested again on php 8.1.3 and it works. But mysqli has removed support for external libraries in 8.2.0

          People

            danblack Daniel Black
            dkasyanov Dmitriy Kasyanov (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.