一文了解swoole如何安裝

一文了解swoole如何安裝

swoole配置在Linux或者ios等類似于Unix環(huán)境中,Windows環(huán)境支持不好。

tar編譯安裝參考:https://www.jianshu.com/p/0c0d19c36ed0

編譯安裝參考:http://www.hu-rong.com/article/323

https://blog.csdn.net/q85795362/article/details/85256206

安裝swoole的步驟如下:

準(zhǔn)備工作:

1、查看linux(這里以CentOS7.6為例)版本:

[root@VM_6_21_centos?~]#?cat?/etc/redhat-release

2、查看PHP版本

[root@VM_6_21_centos?~]#?php?-v

3、查看PHP安裝的擴(kuò)展

[root@VM_6_21_centos?~]#?php?-m

4、查看當(dāng)前所在的位置:

[root@VM_6_21_centos?~]#?pwd

5、安裝依賴包文件 # find / -name phpize 查找:phpize

[root@VM_6_21_centos?~]#?yum?install?php-devel??????#?通過php的工具包添加擴(kuò)展,運(yùn)行命令:phpize ?????????????????yum?install?glibc-headers?? ?????????????????yum?install?gcc-c++? ?????????????????yum?install?git????????????#?git?clone ?????????????????yum?-y?install?nghttp2

6、我是使用oneinstack集成環(huán)境安裝的lnmp

php.ini?位置:/usr/local/php/etc/php.ini??或者??whereis?php.ini

開始安裝

1、cd 到家目錄,下載swoole

[root@VM_6_21_centos?~]#?git?clone?https://github.com/swoole/swoole-src.git [root@VM_6_21_centos?~]#?ls [root@VM_6_21_centos?~]#?mkdir?/usr/local/swoole/

2、拷貝 /root 目錄下的 swoole-src 到 /usr/local/swoole/

[root@VM_6_21_centos?~]#?cp?-r?/root/swoole-src/.??/usr/local/swoole/

3、我的PHP安裝的位置(php7.2.16) /usr/local/php/bin/php-config (具體情況具體對待)

[root@VM_6_21_centos?~]#???cd??/usr/local/swoole/ [root@VM_6_21_centos?swoole]#??./configure???--with-php-config=/usr/local/php/bin/php-config?--enable-sockets? --enable-openssl??--enable-http2????????#?配置 [root@VM_6_21_centos?swoole]#??make?clean?&&?make?&&?sudo?make?install???#?編譯安裝

4、swoole.so 配置所在位置

[root@VM_6_21_centos?~]#?vim??/usr/local/php/etc/php.ini 配置: extension?=/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/swoole.so

一文了解swoole如何安裝

修改了php配置需要平滑啟動(dòng)php-fpm [root@VM_6_21_centos?~]#?ps?-aux?|?grep?php-fpm? 找到phpfpm?的master?process的進(jìn)程id [root@VM_6_21_centos?~]#???kill?-SIGUSR2?process_id??????????#實(shí)現(xiàn)平滑重啟php-fpm

一文了解swoole如何安裝

5、進(jìn)程查看:http://www.hu-rong.com/article/323

PHP中文網(wǎng),大量的免費(fèi)swoole入門教程,歡迎在線學(xué)習(xí)!

以上就是一文了解

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點(diǎn)贊10 分享