首页 正文

php安装event扩展

       1890      2020-06-14 21:49:13    

1、下载libevent文件

下载地址:https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz

2、解压文件

 tar -zxvf libevent-2.1.11-stable.tar.gz

3、然后 进入目录安装

./configure --prefix=/usr/local/libevent
 make && make install

4、看看自己有没有sokects扩展,没有的话自己安装,一般都会有的

php -m

5、下载event扩展,下载、解压、进目录

wget http://pecl.php.net/get/event-2.5.6.tgz 
tar -zxvf event-2.5.6.tgz
cd event-2.5.6

6、用phpize安装

/usr/local/php/bin/phpize 
./configure --with-php-config=/usr/local/php/bin/php-config --with-event-libevent-dir=/usr/local/libevent/
make && make install

7、在php.ini里面加入扩展

echo extension = event.so >> /usr/local/php/etc/php.ini

8、重启php查看扩展安装完成

我要打赏