PHP安裝swoole擴展


環境:gcc
yum install gcc

第一步:下載swoole包
wget http://pecl.php.net/package/swoole
第二步:解壓,並進入
執行:/usr/local/php/bin/phpize
可能會報錯
Cannot find autoconf. Please check your autoconf installation and the? $PHP_AUTOCONF? environment
variable is set correctly and then rerun this script.
解決錯誤
yum -y install gcc automake autoconf libtool make(安裝make)
wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
tar -zvxf m4-1.4.9.tar.gz
cd m4-1.4.9/
./configure && make && make install
cd ../
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz
tar -zvxf autoconf-2.62.tar.gz
cd autoconf-2.62/
./configure && make && make install
然后繼續執行/usr/local/php/bin/phpize
第三步:執行./configure --with-php-config=/usr/local/php/bin/php-config
可能會報錯
configure: error: C++ preprocessor “/lib/cpp” fails sanity
check See `config.log’ for more details
解決辦法:
出現該情況是由於c++編譯器的相關package沒有安裝,以root用戶登陸,在終端上執行:
  # yum install glibc-headers
  # yum install gcc-c++
最后找到php.ini
在里面找到extension_dir="(復制執行完上一步后Installing shared extensions:顯示的路徑)";
添加extension=swoole.so


免責聲明!

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



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