Liunx 下php安装memcached扩展 & redis扩展
2021-01-07 14:28
标签:windows https php inux dir lib nbsp directory adl #liunx 下php安装memcached扩展 memcached扩展是基于libmemcached,所以要先安装libmemcached 一:安装libmemcached 1、wget https://launchpadlibrarian.net/165454254/libmemcached-1.0.18.tar.gz 2、tar zxvf libmemcached-1.0.18.tar.gz 3、cd libmemcached-1.0.18 4、./configure --prefix=/usr/local/libmemcached --with-memcached 5、make 6、make install 二:安装php-memcached 1、wget http://pecl.php.net/get/memcached-2.2.0.tgz 2、tar zxvf memcached-2.2.0.tgz 3、cd memcached-2.2.0 4、/usr/local/php/bin/phpize 5、./configure --enable-memcached --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --disable-memcached 6、make 7、make install
注:windows中的扩展后缀名叫.dll linux中的扩展的后缀名为.so 8、在php.ini(探针中可查看此文件位置)文件中 添加 extension=memcached.so (Module Settings上方)
重启php即可 service php-fpm restart 打开探针【echo phpinfo();】查看是否有memcached #liunx 下php安装redis扩展 一:下载需要的php操作redis的扩展包 1、cd /usr/local/src 2、wget https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz 3、tar -zxvf 2.2.4.tar.gz 4、cd phpredis-2.2.4 5、/usr/local/php/bin/phpize (收集php相关的信息) 6、./configure --with-php-config=/usr/local/php/bin/php-config (用来收集操作系统信息) 7、make 8、make install
9、修改php.ini 文件 在 "; Directory in which the loadable extensions (modules) reside." 下 重启php即可 service php-fpm restart 打开探针【echo phpinfo();】查看是否有redis Liunx 下php安装memcached扩展 & redis扩展 标签:windows https php inux dir lib nbsp directory adl 原文地址:https://www.cnblogs.com/caopeng/p/13560605.html
;extension_dir = "./"
替换以下内容
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/"
extension = "redis.so"
文章标题:Liunx 下php安装memcached扩展 & redis扩展
文章链接:http://soscw.com/index.php/essay/40715.html