博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
通过 pecl 快速安装 php-memcached 扩展
阅读量:7012 次
发布时间:2019-06-28

本文共 2170 字,大约阅读时间需要 7 分钟。

hot3.png

通过 pecl 快速安装 php-memcached 扩展

       以前安装 php-memcached 的时一向都是通过源代码编译方式,那个依赖关系、编译速度让你等啊等,好不烦人啊。无意中从网上得知可以使用 pecl 来快速安装这个扩展,在此进行整理并记录之。
系统环境:CentOS-7.1

1、安装 libmemcached

# yum -y install libmemcached-devel Loaded plugins: langpacksResolving Dependencies--> Running transaction check---> Package libmemcached-devel.x86_64 0:1.0.16-3.el7 will be installed--> Processing Dependency: cyrus-sasl-devel(x86-64) for package: libmemcached-devel-1.0.16-3.el7.x86_64--> Running transaction check---> Package cyrus-sasl-devel.x86_64 0:2.1.26-17.el7 will be installed--> Processing Dependency: cyrus-sasl(x86-64) = 2.1.26-17.el7 for package: cyrus-sasl-devel-2.1.26-17.el7.x86_64--> Running transaction check---> Package cyrus-sasl.x86_64 0:2.1.26-17.el7 will be installed…………省略若干行…………Installed:  libmemcached-devel.x86_64 0:1.0.16-3.el7                                                                             Dependency Installed:  cyrus-sasl.x86_64 0:2.1.26-17.el7                       cyrus-sasl-devel.x86_64 0:2.1.26-17.el7                      Complete!
 
 

2、安装 php-memcached 扩展

# pecl install memcached WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update 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] : /usr building in /var/tmp/pear-build-rootb7OPED/memcached-2.2.0 running: /var/tmp/memcached/configure --with-libmemcached-dir=/usr …………省略若干行………… Build process completed successfully Installing '/usr/lib64/php/modules/memcached.so' install ok: channel://pecl.php.net/memcached-2.2.0 configuration option "php_ini" is not set to php.ini location You should add "extension=memcached.so" to php.ini
 

3 、追加模块到 php.ini 文件

# extension=memcached.so
 
 

Tips:若直接使用 pecl install memcached 无法安装成功,可以使用以下方法--

# pecl download memcached# tar zxvf memcached-xxx# cd memcached-xxx# phpize# ./configure --with-libmemcached-dir=/xxxx/xxx/xxx

转载于:https://my.oschina.net/netmouse/blog/614901

你可能感兴趣的文章
Socket 通信(基础原理、实时聊天系统雏形)
查看>>
理解和使用WPF 验证机制
查看>>
tensorflow 在加载大型的embedding模型参数时,会遇到cannot be larger than 2GB
查看>>
Flutter的教程:ListView
查看>>
xxl-job安装教程
查看>>
SpringBoot(十八)@value、@Import、@ImportResource、@PropertySource
查看>>
[dubbo] Dubbo API 笔记——配置参考
查看>>
The last access date is not changed even after reading the file on Windows 7
查看>>
SQL Server 字符串处理函数
查看>>
恢复系统管理员密码的五大奇招
查看>>
英语形容“漂亮女孩”知多少
查看>>
GridView 获取当前行的索引值
查看>>
PHPCMS V9二次开发:内容模块PC标签调用详解
查看>>
Virtual-Key Codes
查看>>
Azure China (3) 使用Visual Studio 2013证书发布Cloud Service至Azure China
查看>>
xmapp 404设置
查看>>
[js - 算法可视化] 汉诺塔(Hanoi)演示程序
查看>>
Note:JSON
查看>>
分享.NET 3.0的书籍下载(持续更新中)
查看>>
几道有意思的逻辑分析题
查看>>