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

相关文章

1.SW的HttpServerHttpServer的本质仍然是swoole_server,其协...
1、Swoole依赖安装hiredissudowgethttps://github.comedis/h...
直接安装会提示找不到openssl/ssl.h文件即便通过Brew安装了O...
1.安装依赖yum install -y php php-pear php-devel ht...
php
下载swoole地址:https://pan.baidu.com/s/1_N3RiFtT3iHLA5x...
昨晚我躺在床上,百无聊赖地翻阅 阿兰·德波顿《身份的焦虑...