按照swoole官網的wiki,下載源碼php
cd swoole
shell
phpize
swoole
這一步的執行在經過PKG安裝PHP的FreeBSD上面會報錯this
Configuring for: PHP Api Version: 20160303 Zend Module Api No: 20160303 Zend Extension Api No: 320160303 Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.
解決方案 : pkg install autoconf
code
./configure
ip
make
源碼
在FreeBSD上執行這一步操做會有以下報錯it
In file included from /root/swoole/swoole.c:25: In file included from /usr/local/include/php/ext/spl/spl_iterators.h:27: /usr/local/include/php/ext/pcre/php_pcre.h:29:10: fatal error: 'pcre.h' file not found
問題產生緣由: FreeBSD安裝的pcre的"pcre.h"不在swoole搜索的文件路徑io
解決方案: ln -s /usr/local/include/pcre.h /usr/include/pcre.h
class
`make install
在php.ini
文件中添加extension=swoole.so