← Back to team overview

maria-discuss team mailing list archive

[MariaDB 10.2.6] [PHP 7.1.6] error: /usr/bin/ld: cannot find -lmysqlclient | wrong mysql library version or lib not found

 

Hi,

I am compiling MariaDB 10.2.6 and PHP 7.1.6

I'm trying it on Debian 8.8 32x and x64 on DigitalOcean

See the script:
https://gist.github.com/dertin/8de14e458dd4f0d3acb5f0deff120951 <https://gist.github.com/dertin/8de14e458dd4f0d3acb5f0deff120951>

But I have problems compiling PHP with MariaDB / MySQLi.
Should I check something at the Mariadb installation?

# grep 'mysql’ config.log

$ ./configure --prefix=/usr/local/php7 --enable-huge-code-pages --with-config-file-scan-dir=/usr/local/php7/etc/conf.d --without-pear --enable-bcmath --with-bz2 --enable-calendar --enable-intl --enable-exif --enable-dba --enable-ftp --with-gettext --with-gd --with-jpeg-dir --enable-mbstring --with-mcrypt --with-mhash --enable-mysqlnd --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-mysqli=/usr/local/mysql/bin/mariadb_config --with-pdo-mysql=/usr/local/mysql --with-openssl --enable-pcntl --with-pspell --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-zlib --enable-zip --with-readline --with-curl --enable-simplexml --enable-xmlreader --enable-xmlwriter --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data

...

configure:52615: result: /var/run/mysqld/mysqld.sock

configure:52749: checking for mysql_set_server_option in -lmysqlclient

configure:52774: cc -o conftest -I/usr/include -g -O2 -fvisibility=hidden  -Wl,-rpath,/usr/local/mysql/lib/ -L/usr/local/mysql/lib/ -L/usr/lib  -Wl,-rpath,/usr/local/lib -L/usr/local/lib -Wl,-rpath,/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -lmariadb -ldl -lm -lssl -lcrypto conftest.c -lmysqlclient  -lmcrypt -lltdl -lstdc++ -lpng -lz -ljpeg -lcurl -lbz2 -lz -lrt -lm -ldl -lnsl  -lxml2 -lz -lm -ldl -lssl -lcrypto -lcurl -lxml2 -lz -lm -ldl -lssl -lcrypto -licui18n -licuuc -licudata -licuio >&5
/usr/bin/ld: cannot find -lmysqlclient
| char mysql_set_server_option ();
| return mysql_set_server_option ();

configure:53081: error: wrong mysql library version or lib not found. Check config.log for more information.
ac_cv_lib_mysqlclient___mysql_set_server_option=no


Tested with:
 --with-mysqli=/usr/local/mysql/bin/mysql_config
 --with-mysqli=/usr/local/mysql/bin/mariadb_config

related to: https://lists.launchpad.net/maria-discuss/msg04668.html

What do you think?

Guillermo Céspedes
Full Stack Developer




Follow ups