PHP安裝libevent擴展


1.  下載擴展

官方地址http://pecl.php.net/package/libevent

請根據自己的PHP腳本選擇相應版本

wget  http://pecl.php.net/get/libevent-0.0.4.tgz

2.  

下載 wget http://pecl.php.net/get/libevent-0.0.4.tgz

解壓 tar -zxvf libevent-0.0.4.tgz

cd libevent-0.0.4

phpize

./configure --with-php-config=/local/php/bin/php-config

發現報錯 

顯示為re2c版本過低  從http://www.re2c.org/ 下載 

wget http://sourceforge.net/projects/re2c/files/re2c/0.13.5/re2c-0.13.5.tar.gz/download

安裝之
繼續 ./configure --with-php-config=/local/php/bin/php-config 報錯 Cannot find libevent headers 需要安裝libevent 下載 libevent 官網 http://libevent.org/ wget https://github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz tar -zxvf libevent-2.0.20-stable.tar.gz cd libevent-2.0.20-stable ./configure --prefix=/local/libevent-2.0.20-stable/ make && make install 再次安裝擴展,加入 --with-libevent
./configure --with-php-config=/home/users/suqian/.jumbo/php/bin/php-config --with-libevent=/local/libevent-2.0.20-stable/

make && make install

之后配置 php.ini 移動 生成的 .so 文件到 php.ini 中配置的 extensions_dir下
並添加配置

extension="libevent.so"

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM