MariaDB 10.2 and PhpSwitcher 3.0.6 / Error with needed Packages

  • Hello,


    i updated my Debian Jessie Server to the current Stretch Version and then to the latest i-MSCP Version (as described here in the forum). Everything went well and works.
    But i have some problems with the PhpSwitcher Plugin and the need Packages. Because i selected MariaDB 10.2 during the setup and not the default 10.1 for Debian Stretch.


    Here are some infos about the system:


    i-MSCP Infos

    Shell-Script
    1. ## i-MSCP version infoBuildDate = 20170710Version = 1.4.7CodeName = ZimmerPluginApi = 1.4.1# Distro infoDISTRO_ID = debianDISTRO_CODENAME = stretchDISTRO_RELEASE = 9.0FRONTEND_SERVER = nginxFTPD_SERVER = proftpdHTTPD_SERVER = apache_php_fpmMTA_SERVER = postfixNAMED_SERVER = bindPHP_SERVER = php7.0PO_SERVER = dovecotSQL_SERVER = mariadb_10.2


    I´m running PhpSwitcher 3.0.6


    Here is the Error:

    Shell-Script
    1. #/var/www/imscp/gui/plugins/PhpSwitcher/PhpCompiler# perl php_compiler.pl 5.3[INFO] Make target set to `install'[INFO] Installing PHP build dependencies...Paketlisten werden gelesen... FertigAbhängigkeitsbaum wird aufgebaut.Statusinformationen werden eingelesen.... Fertiglibexpat1-dev ist schon die neueste Version (2.2.0-2+deb9u1).libexpat1-dev wurde als manuell installiert festgelegt.locales-all ist schon die neueste Version (2.24-11+deb9u1).autoconf ist schon die neueste Version (2.69-10).autoconf wurde als manuell installiert festgelegt.automake ist schon die neueste Version (1:1.15-6).automake wurde als manuell installiert festgelegt.build-essential ist schon die neueste Version (12.3).libmagic1 ist schon die neueste Version (1:5.30-1).libmagic1 wurde als manuell installiert festgelegt.flex ist schon die neueste Version (2.6.1-1.3).libedit2 ist schon die neueste Version (3.1-20160903-3).libedit2 wurde als manuell installiert festgelegt.libtool ist schon die neueste Version (2.4.6-2).libtool wurde als manuell installiert festgelegt.mime-support ist schon die neueste Version (3.60).netbase ist schon die neueste Version (5.4).netcat-traditional ist schon die neueste Version (1.10-41+b1).libldap2-dev ist schon die neueste Version (2.4.44+dfsg-5).libldap2-dev wurde als manuell installiert festgelegt.libpcre3 ist schon die neueste Version (2:8.39-3).libpcre3 wurde als manuell installiert festgelegt.re2c ist schon die neueste Version (0.16-2).re2c wurde als manuell installiert festgelegt.wget ist schon die neueste Version (1.18-5).zlib1g-dev ist schon die neueste Version (1:1.2.8.dfsg-5).Einige Pakete konnten nicht installiert werden. Das kann bedeuten, dassSie eine unmögliche Situation angefordert haben oder, wenn Sie dieUnstable-Distribution verwenden, dass einige erforderliche Pakete nochnicht erstellt wurden oder Incoming noch nicht verlassen haben.Die folgenden Informationen helfen Ihnen vielleicht, die Situation zu lösen:Die folgenden Pakete haben unerfüllte Abhängigkeiten: libmariadbclient-dev : Hängt ab von: libmariadbclient18 (= 10.1.23-9+deb9u1)[ERROR] main: An unexpected error occurred: An error occurred while installing build dependencies: E: Probleme können nicht korrigiert werden, Sie haben zurückgehaltene defekte Pakete.

    Looks like there are other packages need for MariaDB 10.2 because i´m unable to find the libmariadbclient-dev for version 10.2.


    And of course, the installation aborts because of the wrong version.

    Here are all my installed Packages for MariaDB

    Shell-Script
    1. # dpkg-query -l '*maria*' | grep '^.i'ii libmariadb-dev 10.2.6+maria~stretch amd64 MariaDB database development filesii libmariadb3 10.2.6+maria~stretch amd64 MariaDB database client libraryii libmariadbclient18 10.2.6+maria~stretch amd64 Virtual package to satisfy external dependsii libmariadbd-dev 10.2.6+maria~stretch amd64 MariaDB embedded database, development filesii libmariadbd19:amd64 10.2.6+maria~stretch amd64 MariaDB embedded database, shared libraryii mariadb-client-10.2 10.2.6+maria~stretch amd64 MariaDB database client binariesii mariadb-client-core-10.2 10.2.6+maria~stretch amd64 MariaDB database core client binariesii mariadb-common 10.2.6+maria~stretch all MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf)ii mariadb-server-10.2 10.2.6+maria~stretch amd64 MariaDB database server binariesii mariadb-server-core-10.2 10.2.6+maria~stretch amd64 MariaDB database core server files

    I´m not sure if there are there still some development files/packages missing ?


    Here is my sources.list

    Thanks for any help!

  • @BeNe


    Thank for the report.


    The situation:


    The libmariadbclient-dev package is not provided by MariaDB 10.2 repository. It has been replaced by the libmariadb-dev package. However, the MySQL compatibility symlinks that are provided by the libmariadb-dev package are dangling (broken). See https://jira.mariadb.org/browse/MDEV-13455


    Anyway, even if we create those MySQL compatibility symlinks manually (making them pointing to libmariadb.so which itself point to libmariadb.so.3), the configuration for both PHP 4.4 and 5.2 all PHP versions (that don't make use of mysqlnd) pass but their are build failures ... It seem that some header files such as /usr/include/mysql/mysql_version.h (which is provided by the libmariadb-dev package) are not correctly included, leading to errors such as:

    Shell-Script
    1. /usr/local/src/phpswitcher/php-4.4.9/ext/mysql/php_mysql.c:328:24: error: 'MYSQL_PORT' undeclared (first use in this function)

    The story


    We need the MySQL development libraries and header files only to build PHP 4.4, 5.2 since for the others version (5.3, 5.4, 5.5, 5.6, 7.0, 7.1), we use the native MySQL driver (mysqlnd) that is bundled with those PHP versions...


    The easy solution I've found is as follow: Enforce installation of the libmariadbclient18 package (MariaDB 10.1) that is provided by Debian Team, which allows us to install the libmariadbclient-dev package from Debian Team in place of the libmariadb-dev package:


    /etc/apt/preferences.d/phpswitcher

    Code
    1. Package: libmariadbclient18Pin: release o=DebianPin-Priority: 1002
    Shell-Script
    1. # apt-get -y dist-upgrade# apt-get libmariadbclient-dev

    Then, run the following script to remove dangling symlinks and create those that are needed:

    Of course, that solution is only temporal. I need fix all FTBFS issues by patching sources...

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @Nuxwin


    Big Thanks for your time and investigation!
    Just for my understanding:


    We need the MySQL client library only to build PHP 4.4, 5.2 since for the others version (5.3, 5.4, 5.5, 5.6, 7.0, 7.1), we use the native MySQL driver (mysqlnd) that is bundle with those PHP versions...

    So if i _only_ need PHP Version 5.3 or higher i don´t need to install "libmariadbclient-dev" because we use the native MySQL driver (mysqlnd) that is bundled with those PHP versions ?
    Mean´s - i can remove the "libmariadbclient-dev" from the php_compiler.pl dependencies list and start to compile ? Just as a fast workaround.


    Thanks!

  • So if i _only_ need PHP Version 5.3 or higher i don´t need to install "libmariadbclient-dev" because we use the native MySQL driver (mysqlnd) that is bundle with those PHP versions ?
    Mean´s - i can remove the "libmariadbclient-dev" from the php_compiler.pl dependencies list and start to compile ? Just as a fast workaround.


    Thanks!

    Exactly ;)

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • The FTBFS issues affect all PHP versions when we don't use mysqlnd. I was wondering why there was build failures with MariaDB 10.2 and not with the olders, thus, I've tested building PHP 7.1 without mysqlnd.


    Well, in MariaDB 10.2, they added a new mysql/mariadb_version.h header file which is included in the mysql/mysql.h header file in place of the historical mysql/mysql_version.h header file.


    The problem is that PHP assume that the mysql/mysql_version.h header file is included in the mysql/mysql.h header file but that is not longer the case. Fortunately, the mysql/mysql_version.h header file is still provided.


    Well, that seem not a big issue as long as we are aware of it. I'll have to add a patch for all PHP versions, for including the mysql_version.h header file.


    There is pleinty of project affected by this change, such as:

    Furthermore, there are some other changes causing other FTBFS issues such as:

    Shell-Script
    1. /usr/local/src/phpswitcher/php-7.1.8/ext/mysqli/mysqli_nonapi.c: In function ‘mysqli_common_connect’:/usr/local/src/phpswitcher/php-7.1.8/ext/mysqli/mysqli_nonapi.c:266:14: error: ‘MYSQL {aka struct st_mysql}’ has no member named ‘reconnect’mysql->mysql->reconnect = MyG(reconnect);

    which can be fixed by replacing:


    C
    1. #if !defined(MYSQLI_USE_MYSQLND) mysql->mysql->reconnect = MyG(reconnect);#endif

    by

    C
    1. #if !defined(MYSQLI_USE_MYSQLND)
    2. mysql_options(mysql->mysql, MYSQL_OPT_RECONNECT, (my_bool *)&MyG(reconnect));
    3. #endif

    in the /usr/local/src/phpswitcher/php-7.1.8/ext/mysqli/mysqli_nonapi.c file


    See also: https://dev.mysql.com/doc/refman/5.7/en/mysql-options.html (MYSQL_OPT_RECONNECT option)


    Again, this change affect several other projects such as: https://bugzilla.redhat.com/show_bug.cgi?id=1470036

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • A new version has been released. See PhpSwitcher plugin v4.0.0 RELEASED
    Thread closed.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206