php安装扩展的方法
检测环境
查看已安装的扩展
php -m
PHP CLI的php.ini文件的位置
php --ini
安装memcached扩展
方法一:apt命令安装
查找扩展包
apt-cache search memcached php
安装扩展包
sudo apt install php-memcache
方法二:yum命令安装
yum search memcached php
yum install -y php-pecl-memcached
方法三:pecl命令安装
pecl install memcached
方法四:phpize安装
扩展下载地址
http://pecl.php.net
下载libevent扩展文件压缩包
wget http://pecl.php.net/get/libevent-0.1.0.tgz
解压
tar -zxvf libevent-0.1.0.tgz
进入文件夹
cd libevent-0.1.0/
运行phpize命令
phpize
运行 configure命令
./configure
运行make
make
运行make install
make install
配置ini文件
通过运行 php --ini查找php.ini文件位置,然后在文件中添加extension=libevent.so

浙公网安备 33010602011771号