按照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