如何编译PHP7的memcached扩展?
- 内容介绍
- 文章标签
- 相关推荐
本文共计411个文字,预计阅读时间需要2分钟。
本篇教程将指导您安装PHP7扩展memcached。以下步骤简洁明了,不超过100字:
1. 访问http://pecl.php.net,查找PHP扩展库。
2.搜索memcached,选择稳定版(stable)。
3.下载源码到服务器,解压。
4.使用phpize创建configure文件。
5.运行configure,生成Makefile。
6.执行make编译,然后make install安装。
本次编译PHP7扩展,以 memcached 为例
1.进入 pecl.php.net PHP的扩展库
2.搜索 memcached 复制 stable版 源码链接
3.下载到服务器并解压
4.使用 phpize 创建 configure 文件
5.生成 Makefile 并 编译安装
6.把生成的 .so 扩展,在 php.ini 里引入
7.重启 PHP 或 重启 Apache
wget pecl.php.net/get/memcached-3.0.3.tgz tar xzf memcached-3.0.3.tgz cd memcached-3.0.3 /path/php/bin/phpize #path 为 PHP路径 ./configure --with-php-config=/path/php/bin/php-config
提示缺少 libmemcached
wget launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz tar xzf libmemcached-1.0.18 cd libmemcached-1.0.18 ./configure --prefix=/usr/local/libmemcached make && make install cd memcached-3.0.3 ./configure --with-php-config=/usr/local/php7/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached
继续报错
./configure --with-php-config=/usr/local/php7/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --disable-memcached-sasl make && make install vim php.ini 加入: extension=memcached.so #或填绝对路径
重启PHP
pkill -9 php /usr/local/php7/sbin/php-fpm
查看 phpinfo 页面,就可以看到 memcached 扩展成功安装了
编译安装时,缺啥补啥就行。
本文共计411个文字,预计阅读时间需要2分钟。
本篇教程将指导您安装PHP7扩展memcached。以下步骤简洁明了,不超过100字:
1. 访问http://pecl.php.net,查找PHP扩展库。
2.搜索memcached,选择稳定版(stable)。
3.下载源码到服务器,解压。
4.使用phpize创建configure文件。
5.运行configure,生成Makefile。
6.执行make编译,然后make install安装。
本次编译PHP7扩展,以 memcached 为例
1.进入 pecl.php.net PHP的扩展库
2.搜索 memcached 复制 stable版 源码链接
3.下载到服务器并解压
4.使用 phpize 创建 configure 文件
5.生成 Makefile 并 编译安装
6.把生成的 .so 扩展,在 php.ini 里引入
7.重启 PHP 或 重启 Apache
wget pecl.php.net/get/memcached-3.0.3.tgz tar xzf memcached-3.0.3.tgz cd memcached-3.0.3 /path/php/bin/phpize #path 为 PHP路径 ./configure --with-php-config=/path/php/bin/php-config
提示缺少 libmemcached
wget launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz tar xzf libmemcached-1.0.18 cd libmemcached-1.0.18 ./configure --prefix=/usr/local/libmemcached make && make install cd memcached-3.0.3 ./configure --with-php-config=/usr/local/php7/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached
继续报错
./configure --with-php-config=/usr/local/php7/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --disable-memcached-sasl make && make install vim php.ini 加入: extension=memcached.so #或填绝对路径
重启PHP
pkill -9 php /usr/local/php7/sbin/php-fpm
查看 phpinfo 页面,就可以看到 memcached 扩展成功安装了
编译安装时,缺啥补啥就行。

