centos8安装php扩展memcached报错

在php扩展memcached中执行./configure --with-php-config=/usr/local/php/bin/php-config 报错:

error: memcached support requires libmemcached. Use --with-lib memcached-dir。。。。。。

然后去安装libmemcached,但是yum安装的方式还是报错,

然后就考虑源码编译安装:(下载目录:)https://launchpad.net/libmemcached/+download 

开始下载的是 https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz

在make阶段一直报错

然后就下载了 https://launchpad.net/libmemcached/1.0/1.0.15/+download/libmemcached-1.0.15.tar.gz

还是报错:但是错误简单,能看懂了:

clients/memflush.cc:42:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
        if (opt_servers == false)
                           ^~~~~
clients/memflush.cc:51:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
        if (opt_servers == false)
                           ^~~~~

然后修改 文件 clients/memflush.cc 中的 

#修改 if (opt_servers == false)     为
if (! opt_servers)

然后,重新安装:

make
make install

中途会有warning,不用管

 

posted @ 2020-06-24 16:15  study_php_java_C++  阅读(823)  评论(0编辑  收藏  举报