Centos7安装swoole扩展操作示例
网络编程 2021-07-04 23:05www.168986.cn编程入门
这篇文章主要介绍了Centos7安装swoole扩展操作,详细分析了Centos7安装swoole扩展的具体步骤、相关操作命令与使用注意事项,需要的朋友可以参考下
本文实例讲述了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 g [root@localhost html]# yum install g-c++ [root@localhost html]# yum install g-g77
- 安装swoole
[root@localhost html]# pecl install swoole ... // 是否启用 PHP Sockets 支持 enable sockets supports? [no] : yes // 是否启用 OpenSSL 支持 enable openssl support? [no] : yes // 是否启用 HTTP2 支持 enable http2 support? [no] : yes // 是否启用 MySQL 原生支持 enable mysqlnd support? [no] : yes
安装成功
Build process pleted suessfully Installing '/usr/lib64/php/modules/swoole.so' Installing '/usr/include/php/ext/swoole/config.h' install ok: channel://pecl.php./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狼蚁网站SEO优化,后重启php-fpm
php -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 g g-c++ g-g77
fatal error: openssl/ssl.h: No such file or directory // 没有openssl/ssl此类文件或目录 // yum install openssl-devel
error “Enable http2 support, require nghttp2 library. // wget https://github./nghttp2/nghttp2/releases/download/v1.34.0/nghttp2-1.34.0.tar.bz2 // tar -xjf nghttp2-1.34.0.tar.bz2
PHP 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系统配置有所帮助。
编程语言
- 机械手焊接机器人编程 机械手焊接设备编程
- vb数据库编程实例,vb做数据库
- tiobe世界编程语言排行榜,全球编程语言排行
- 成都java编程培训 成都it编程培训中心
- 编程基础培训,编程基础知识培训
- flash游戏编程基础教程,flash游戏开发教程
- 不会英语能学编程吗 不会英语可以学程序员吗
- 爱心代码编程C语言 爱心代码编程c语言公式
- c语言编程学习入门 c语言编程快速入门
- 西门子plc编程培训 西门子plc编程培训班
- 哪里可以学编程 台州哪里可以学编程
- 少儿编程哪个好 少儿编程哪个品牌好
- 编程是什么意思,图形编程是什么意思
- c语言编程软件下载,c语言编程软件在哪下载
- java编程软件下载,java编程下载手机版
- ug编程培训学校,ug编程培训教程