php-apm icon indicating copy to clipboard operation
php-apm copied to clipboard

Unable to install from source on CentOS 7

Open Rosiak opened this issue 8 years ago • 5 comments

[root@localhost php-apm]# rpm -qa | grep php
php70w-pdo-7.0.10-1.w7.x86_64
php70w-mcrypt-7.0.10-1.w7.x86_64
php70w-common-7.0.10-1.w7.x86_64
php70w-devel-7.0.10-1.w7.x86_64
php70w-fpm-7.0.10-1.w7.x86_64
php70w-gd-7.0.10-1.w7.x86_64
php70w-snmp-7.0.10-1.w7.x86_64
php70w-process-7.0.10-1.w7.x86_64
php70w-mysql-7.0.7-1.w7.x86_64
php70w-cli-7.0.10-1.w7.x86_64
php70w-7.0.10-1.w7.x86_64
php70w-xml-7.0.10-1.w7.x86_64
php70w-pear-1.10.1-1.w7.noarch

[root@localhost php-apm]# rpm -qa | grep maria
mariadb-libs-5.5.50-1.el7_2.x86_64
mariadb-5.5.50-1.el7_2.x86_64
mariadb-server-5.5.50-1.el7_2.x86_64
mariadb-devel-5.5.50-1.el7_2.x86_64

[root@localhost php-apm]# ./configure --with-php-config=/usr/bin/php-config --with-sqlite3=no --with-mysql=/usr/lib64/mysql --enable-socket=no --enable-statsd=no
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.14.3 (ok)
checking for gawk... gawk
checking whether to enable apm support... yes, shared
checking enable support for sqlite3... no
checking enable support for MySQL... /usr/lib64/mysql
checking enable support for statsd... no
checking enable support for socket... no
checking enable the debug file... no
checking set default sqlite3 default DB path... no
checking for the location of libz... no
configure: error: Cannot find libmysqlclient under /usr.

Rosiak avatar Sep 01 '16 11:09 Rosiak

libmysqlclient not installed or wrong lib islocation

yjqg6666 avatar Nov 24 '16 00:11 yjqg6666

Encountered the same error on centos 7 with mariadb 10.1 from mariadb repo + php5.6 from IUS repo (worth mentioning since script looks for mysql libs in PHP_LIBDIR). Solved this by defining MYSQL_LIB_DIR like this $ MYSQL_LIB_DIR=/usr/lib64 ./configure

Fil0sOFF avatar Nov 25 '16 20:11 Fil0sOFF

Use remi repository which provides this extension and lot of others instead of trying to build from sources.

remicollet avatar Feb 13 '17 15:02 remicollet

@remicollet 's suggestion is indeed what I recommend you to do. However, I should support native compilation too.

Does the following patch solve the issue?:

diff --git config.m4 config.m4
index f89a54d..a02032b 100644
--- config.m4
+++ config.m4
@@ -141,14 +141,17 @@ if test "$PHP_APM" != "no"; then
 
     if test -z "$MYSQL_LIB_DIR"; then
        MYSQL_LIB_CHK(lib/x86_64-linux-gnu)
     fi
     if test -z "$MYSQL_LIB_DIR"; then
       MYSQL_LIB_CHK(lib/i386-linux-gnu)
     fi
+    if test -z "$MYSQL_LIB_DIR"; then
+      MYSQL_LIB_CHK(usr/lib64)
+    fi
 
     for i in $PHP_LIBDIR $PHP_LIBDIR/mysql; do
       MYSQL_LIB_CHK($i)
     done
 
     if test -z "$MYSQL_LIB_DIR"; then
       AC_MSG_ERROR([Cannot find lib$MYSQL_LIBNAME under $MYSQL_DIR.])

patrickallaert avatar Feb 13 '17 18:02 patrickallaert

@patrickallaert Using --with-libdir=lib64 sould be enough

BTW proper fix is probably to rely on mysql_config output (and perhaps #45...)

remicollet avatar Feb 13 '17 18:02 remicollet