无为清净楼资源网 Design By www.qnjia.com
本文实例讲述了Centos7安装swoole扩展操作。分享给大家供大家参考,具体如下:
我的PHP版本为PHP 7.2.24
- 更新源
[root@localhost html]# yum update
- 安装需要支持的扩展
[root@localhost html]# yum install php72w-devel [root@localhost html]# yum install php72w-pear [root@localhost html]# yum install gcc [root@localhost html]# yum install gcc-c++ [root@localhost html]# yum install gcc-g77
- 安装swoole
[root@localhost html]# pecl install swoole ... // 是否启用 PHP Sockets 支持 enable sockets supports"htmlcode">Build process completed successfully Installing '/usr/lib64/php/modules/swoole.so' Installing '/usr/include/php/ext/swoole/config.h' install ok: channel://pecl.php.net/swoole-4.4.12 configuration option "php_ini" is not set to php.ini location You should add "extension=swoole.so" to php.ini安装失败
PHP Startup: Unable to load dynamic library 'swoole.so' (tried: /usr/lib64/php/modules/swoole.so (/usr/lib64/php/modules/swoole.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/swoole.so.so (/usr/lib64/php/modules/swoole.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 // 把extension=swoole.so加到socket的加载后面,在php7.2中进入/etc/php.d下,在sockets.ini中将extension=swoole.so加到extension=sockets.so下面,后重启php-fpmphp -m或者 phpinfo()查看不到swoole
解决方法:
1. 确认安装和配置是否有问题
2、如果使用php -m无法查看swoole,请使用命令service php-fpm restart重启
3、如果使用phpinfo()无法查看swoole,请使用命令service httpd restart重启
C++ preprocessor “/lib/cpp” fails sanity check // 没有c++库 // yum install glibc-headers // yum install gcc gcc-c++ gcc-g77fatal error: openssl/ssl.h: No such file or directory // 没有openssl/ssl此类文件或目录 // yum install openssl-develerror “Enable http2 support, require nghttp2 library. // wget https://github.com/nghttp2/nghttp2/releases/download/v1.34.0/nghttp2-1.34.0.tar.bz2 // tar -xjf nghttp2-1.34.0.tar.bz2PHP Warning: Module 'swoole' already loaded in Unknown on line 0 // 在修改配置时extension=swoole.so别放在最后,最好放在extension=sockets.so后面
- 修改配置
[root@localhost html]# vim /etc/php.ini ... extension=swoole.so ....
- 重启
[root@localhost html]# /bin/systemctl restart php-fpm.service [root@localhost html]# /bin/systemctl restart httpd.service
- 验证是否安装成功
php -m 或者 phpinfo() 查看是否有swoole[root@localhost /]# php --ri swoole希望本文所述对大家centos系统配置有所帮助。
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
更新日志
2024年09月25日
2024年09月25日
- 《叶倩文 真心真意过一生》[WAV+CUE][400MB]
- 潘越云.1985-世间女子(滚石25周年经典复刻版)【滚石】【WAV+CUE】
- 陈柏宇.2009-CANT.BE.HALF【SONY】【WAV+CUE】
- 李明依.1989-小女生【滚石】【WAV+CUE】
- 《李荣浩 新时代创作新人王》[WAV分轨][310MB]
- 《黑鸭子与马头琴 史上最动听草原音乐》[WAV+CUE][320MB]
- 《汽车发烧音乐精选CD18》[FLAC+CUE][7.1G]
- 郑希怡.2004-Perfect.Date【英皇娱乐】【FLAC分轨】
- 群星.1994-宝丽金超级孖宝2CD【宝丽金】【WAV+CUE】
- 林忆莲.2019-0(2023精装版)【环球】【WAV+CUE】
- Supper.Moment.2016-The.Moment【寰亚】【FLAC分轨】
- 范莉丝.1979-送郎一朵牵牛花(LP版)【大联机构】【WAV+CUE】
- 刘宇.2024-宇宙诗人【哔哟哔哟文化】【FLAC分轨】
- 《全景声白噪音》沉浸式大自然助眠 带你听自然的声音[mp3]
- 纯音入心系列纯音乐《古筝精选 十指弹一赏心曲一心奏出世人心》1CD[MP3][582MB]