WHM PHP PECL memcached安装错误CentOS7

分享于 

7分钟阅读

互联网

  繁體

问题:

我试图将php-pecl-memcached模块安装到CentOS7 VPS上,但出现与libmemcached相关的错误,但服务器上已经安装了memcached和libmemcached,并且memcached服务正在运行。以下是WHM模块安装程序日志:


WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to


 update


pecl/memcached can optionally use PHP extension "igbinary" (version >= 2.0)


pecl/memcached can optionally use PHP extension "msgpack" (version >= 2.0)


downloading memcached-3.1.5.tgz ...


Starting to download memcached-3.1.5.tgz (83,015 bytes)


....................done: 83,015 bytes


15 source files, building


running: phpize


Configuring for:


PHP Api Version: 20170718


Zend Module Api No: 20170718


Zend Extension Api No: 320170718


libmemcached directory [no] : zlib directory [no] : use system fastlz [no] : enable igbinary seriali


zer [no] : enable msgpack serializer [no] : enable json serializer [no] : enable server protocol [no


] : enable sasl [yes] : enable sessions [yes] : building in /root/tmp/pear/pear-build-rootKPFrVN/mem


cached-3.1.5


running: /root/tmp/pear/memcached/configure --with-php-config=/opt/cpanel/ea-php72/root/usr/bin/php-


config --with-libmemcached-dir=no --with-zlib-dir=no --with-system-fastlz=no --enable-memcached-igbi


nary=no --enable-memcached-msgpack=no --enable-memcached-json=no --enable-memcached-protocol=no --en


able-memcached-sasl=yes --enable-memcached-session=yes


checking for grep that handles long lines and -e... /bin/grep


checking for egrep... /bin/grep -E


checking for a sed that does not truncate output... /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... /opt/cpanel/ea-php72/root/usr


checking for PHP includes... -I/opt/cpanel/ea-php72/root/usr/include/php -I/opt/cpanel/ea-php72/root


/usr/include/php/main -I/opt/cpanel/ea-php72/root/usr/include/php/TSRM -I/opt/cpanel/ea-php72/root/u


sr/include/php/Zend -I/opt/cpanel/ea-php72/root/usr/include/php/ext -I/opt/cpanel/ea-php72/root/usr/


include/php/ext/date/lib


checking for PHP extension directory... /opt/cpanel/ea-php72/root/usr/lib64/php/modules


checking for PHP installed headers prefix... /opt/cpanel/ea-php72/root/usr/include/php


checking if debug is enabled... no


checking if zts is enabled... no


checking for re2c... no


configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.


checking for gawk... gawk


checking whether to enable memcached support... yes, shared


checking for libmemcached... yes, shared


checking whether to enable memcached session handler support... yes


checking whether to enable memcached igbinary serializer support... no


checking whether to enable memcached json serializer support... no


checking whether to enable memcached msgpack serializer support... no


checking whether to enable memcached sasl support... yes


checking whether to enable memcached protocol support... no


checking whether to use system FastLZ library... no


checking for ZLIB... yes, shared


checking for pkg-config... /bin/pkg-config


checking for zlib location... /usr


checking for session includes... /opt/cpanel/ea-php72/root/usr/include/php


checking for memcached session support... enabled


checking for memcached igbinary support... disabled


checking for memcached msgpack support... disabled


checking for libmemcached location... configure: error: memcached support requires libmemcached. Use


 --with-libmemcached-dir=


 to specify the prefix where libmemcached headers and library are loca


ted


ERROR: `/root/tmp/pear/memcached/configure --with-php-config=/opt/cpanel/ea-php72/root/usr/bin/php-c


onfig --with-libmemcached-dir=no --with-zlib-dir=no --with-system-fastlz=no --enable-memcached-igbin


ary=no --enable-memcached-msgpack=no --enable-memcached-json=no --enable-memcached-protocol=no --ena


ble-memcached-sasl=yes --enable-memcached-session=yes' failed 



我还尝试通过SSH安装它,但也得到一个错误:


$ sudo yum install php-pecl-memcached



...



Transaction check error:


 file /usr/bin/php from install of php-cli-5.4.16-48.el7.x86_64 conflicts with file from package ea-php-cli-1.0.0-9.9.3.cpanel.x86_64



Error Summary


-------------





答案1:

我猜错误"memcached支持需要libmemcached"应该显示为"memcached支持需要libmemcached *"。sudo yum install -y libmemcached-devel



PHP  memcache  Memcached  Centos  WHM  PECL