Centos

安裝 PECL 擴展 Memcache 時出現問題

  • June 14, 2018

我已經很好地安裝了 memcached 並且看起來工作正常,現在我需要安裝 PECL 擴展 memcache。我正在執行 Centos 6.2 x86_64。當我嘗試安裝時,底部出現了這個錯誤:

downloading memcached-2.2.0.tgz ...
Starting to download memcached-2.2.0.tgz (70,449 bytes)
.................done: 70,449 bytes
15 source files, building
running: phpize
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
libmemcached directory [no] : no
building in /var/tmp/pear-build-rootpyG6h1/memcached-2.2.0
running: /var/tmp/memcached/configure --with-libmemcached-dir=no
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 for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
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/i                                 nclude/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/ph                                 p/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.13.5 (ok)
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 for ZLIB... yes, shared
checking for pkg-config... /usr/bin/pkg-config
checking for zlib location... /usr
checking for session includes... /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... found version 0.31, under /usr
checking whether to enable sasl support... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sasl/sasl.h usability... yes
checking sasl/sasl.h presence... yes
checking for sasl/sasl.h... yes
checking whether libmemcached supports sasl... no
configure: error: no, libmemcached sasl support is not enabled. Run configure wi                                 th --disable-memcached-sasl to disable this check
ERROR: `/var/tmp/memcached/configure --with-libmemcached-dir=no' failed

Memcached 統計數據為:

memcached-tool 127.0.0.1:11211 stats
#127.0.0.1:11211   Field       Value
        accepting_conns           1
              auth_cmds           0
            auth_errors           0
                  bytes           0
             bytes_read          81
          bytes_written        1149
             cas_badval           0
               cas_hits           0
             cas_misses           0
              cmd_flush           0
                cmd_get           0
                cmd_set           0
              cmd_touch           0
            conn_yields           0
  connection_structures          11
      crawler_reclaimed           0
       curr_connections          10
             curr_items           0
              decr_hits           0
            decr_misses           0
            delete_hits           0
          delete_misses           0
      evicted_unfetched           0
              evictions           0
      expired_unfetched           0
               get_hits           0
             get_misses           0
             hash_bytes      524288
      hash_is_expanding           0
       hash_power_level          16
              incr_hits           0
            incr_misses           0
               libevent 2.0.22-stable
         limit_maxbytes    67108864
    listen_disabled_num           0
      lrutail_reflocked           0
           malloc_fails           0
                    pid       28884
           pointer_size          64
              reclaimed           0
           reserved_fds          20
          rusage_system    0.000999
            rusage_user    0.000999
                threads           4
                   time  1431481315
      total_connections          14
            total_items           0
             touch_hits           0
           touch_misses           0
                 uptime       59682
                version      1.4.22

netstat -tap | grep memcached
tcp        0      0 *:memcache                  *:*                         LISTEN      28884/memcached
tcp        0      0 *:memcache                  *:*                         LISTEN      28884/memcached

ps到

ps aux | grep memcached
   root      8998  0.0  0.0 103236   856 pts/1    S+   11:45   0:00 grep memcached
   492      28884  0.0  0.0 338100  1320 ?        Ssl  May12   0:00 memcached -d -p 11211 -u memcached -m 64 -c 1024 -P /var/run/memcached/memcached.pid

Pecl 列表

Installed packages, channel pecl.php.net:
=========================================
Package  Version State
APC      3.1.13  beta
memcache 3.0.8   beta

我真的很感激一些建議來解決這個問題 THX

yum groupinstall 'Development Tools'並且yum install zlib-devel已經安裝

我試圖執行yum install memcached-beta --disable-memcached-saslyum install memcached-beta --enable-memcached-sasl=no 但結果相同

Memcached >2.1 至少需要 libmemcached 1.x。您似乎仍然安裝了 0.31。

刪除目前的 libmemcached 包並安裝 libmemcached10(加上 -devel)。

這些包可以在(至少)IUS 儲存庫中找到。

引用自:https://serverfault.com/questions/691601