php安装swoole扩展

1、安装

# wget https://github.com/swoole/swoole-src/archive/swoole-1.7.6-stable.tar.gz 
  • 1
# tar zxvf swoole-1.7.6-stable.tar.gz
# cd swoole-1.7.6-stable 
# phpize 
# ./configure 
# make  && make install** 

提示: 

有时php的扩展模块我们虽然生成了,重新启动会发现在phpinfo并未加载成功:

是因为swoole的编译版并未带debug模式,而我们php安装的当前版本是带debug模式的,我们只要将swoole和php重新编译

重新编译swoole时加上--enable-debug即可

 find / -name php-config

 ./configure --enable-debug --with-php-config=这里放入上一步命令中显示的绝对路径

2、php加载swoole扩展

php -i | grep php.ini

查询php.ini所在path路径  进入该路径中

添加extension=swoole.so 到 php.ini中


3、重启服务 
service php-fpm restart 
service nginx restart

4、测试,查看phpinfo信息,如下图所示:

文章转载至:https://blog.csdn.net/xujialei0704/article/details/80325061

猜你喜欢

转载自blog.csdn.net/a315821168/article/details/80332710