欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Centos7安裝swoole擴展操作示例

 更新時間:2020年03月26日 11:45:07   作者:OldKind超  
這篇文章主要介紹了Centos7安裝swoole擴展操作,詳細分析了Centos7安裝swoole擴展的具體步驟、相關操作命令與使用注意事項,需要的朋友可以參考下

本文實例講述了Centos7安裝swoole擴展操作。分享給大家供大家參考,具體如下:

我的PHP版本為PHP 7.2.24
  1. 更新源
[root@localhost html]# yum update
  1. 安裝需要支持的擴展
[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
  1. 安裝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 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-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 gcc gcc-c++ gcc-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.com/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后面
  1. 修改配置
[root@localhost html]# vim /etc/php.ini
...
extension=swoole.so
....
  1. 重啟
[root@localhost html]# /bin/systemctl restart php-fpm.service
[root@localhost html]# /bin/systemctl restart httpd.service
  1. 驗證是否安裝成功
php -m 或者 phpinfo() 查看是否有swoole

在這里插入圖片描述

[root@localhost /]# php --ri swoole

希望本文所述對大家centos系統(tǒng)配置有所幫助。

相關文章

最新評論