Re: /usr/bin/ld: cannot find -lmysqlclient | error: wrong mysql library version or lib not found

From: Date: Tue, 04 Jul 2017 16:10:39 +0000
Subject: Re: /usr/bin/ld: cannot find -lmysqlclient | error: wrong mysql library version or lib not found
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-99740@lists.php.net to get a copy of this message
Hi, On Mo, 2017-07-03 at 19:17 -0300, Guillermo Cespedes wrote: > Hi, > > I am compiling MariaDB 10.2.6 and PHP 7.1.6 > > I'm trying it on Debian 8.8 32x / x64 on DigitalOcean > > See the script: > https://gist.github.com/dertin/8de14e458dd4f0d3acb5f0deff120951 > > But I have problems compiling PHP with MariaDB > > # grep 'mysql’ config.log [...] > configure:52749: checking for mysql_set_server_option in > -lmysqlclient The cause for the behavior seems to be that the mysqli/config.m4 file checks your the information provided by the "config" program you passed, but for feature check uses the hard coded name of libmysql. Maybe this could be refactored to a simpler version check and discontinue support for versions before 5.0 ... if you send me the output from      mariadb_config --libs and     mariadb_config --version I can see if I can cook up a patch. That said: Preferred way is to build using mysqlnd instead of libmysql, so just use  --with-mysql and --with-pdo-mysql without path (or, in case you like it explicit, =mysqlnd for both) that's the client library optimized for PHP. See http://php.net/manual/en/mysqlinfo.library.choosing.php Also mind that MariaDB is a downstream fork of MySQL and both systems are diverting and likely will divert more over time. Experience can vary. johannes Note: I'm a member of Oracle's MySQL engineering team. Personal opinions. No promises from Oracle.

« previous php.internals (#99740) next »