1、php的libevent扩展依赖于系统的libevent库,所以必须先把libevent库安装上。

> yum -y install libevent-devel

2、下载libevent扩展
在 http://pecl.php.net/package/libevent 中找到合适的版本

3、解压安装包

> tar -zxvf libevent-0.1.0.tgz

4、进入目录,通过phpize命令生成configure (*我的PHP安装在/data/php下)

> cd libevent-0.1.0

> /data/php/bin/phpize

5、运行configure

> ./configure --with-php-config=/data/php/bin/php-config

6、make & make install

> make
> make install

7、在/data/php/lib/php.ini中添加

extension=libevent.so

8、重启服务器

 

相关文章:

  • 2021-12-18
  • 2021-12-21
  • 2022-03-08
  • 2021-10-17
  • 2022-12-23
猜你喜欢
  • 2021-08-14
  • 2022-12-23
  • 2021-11-02
  • 2021-10-22
  • 2022-02-28
  • 2021-09-19
  • 2022-01-03
相关资源
相似解决方案