Home > PHP Framework > Swoole > Detailed swoole installation

Detailed swoole installation

coldplay.xixi
Release: 2021-02-05 17:50:12
forward
4746 people have browsed it

Detailed swoole installation

Recommended (free): swoole

PHP version: php7
swoole version: swoole (latest)
Server: CentOS 7.6

swoole is configured in a Unix-like environment such as Linux or ios, and the Windows environment does not support it well

tar compilation and installation reference: https: //www.jianshu.com/p/0c0d19c36ed0

Compilation and installation reference: http://www.hu-rong.com/article/323

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

The steps to install swoole are as follows:

Preparation work:

1, check the linux (CentOS7.6 is used as an example here) version :

[root@VM_6_21_centos ~]# cat /etc/redhat-release
Copy after login

2, check the PHP version

[root@VM_6_21_centos ~]# php -v
Copy after login

3, check the extensions installed by PHP

[root@VM_6_21_centos ~]# php -m
Copy after login

4, check the current location:

[root@VM_6_21_centos ~]# pwd
Copy after login

5 , Install dependency package files # find / -name phpize Find: phpize

[root@VM_6_21_centos ~]# yum install php-devel      # 通过php的工具包添加扩展,运行命令:phpize
                         yum install glibc-headers  
                         yum install gcc-c++ 
                         yum install git            # git clone
                         yum -y install nghttp2
Copy after login

6, I installed lnmp

php.ini 位置   :  /usr/local/php/etc/php.ini    或者  whereis php.ini
Copy after login

using oneinstack integrated environment, start the installation

1, cd Go to your home directory, download 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/
Copy after login

2, copy swoole-src in the /root directory to /usr/local/swoole/

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

3, the location of my PHP installation (php7.2.16 ) /usr/local/php/bin/php-config (Specific situations will be treated on a case-by-case basis)

[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   # 编译安装
Copy after login

4, swoole.so configuration location

[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
Copy after login

Detailed swoole installation

修改了php配置需要平滑启动php-fpm[root@VM_6_21_centos ~]# ps -aux | grep php-fpm 找到phpfpm 的master process的进程id[root@VM_6_21_centos ~]#   kill -SIGUSR2 process_id          #实现平滑重启php-fpm
Copy after login

Detailed swoole installation

The above is the detailed content of Detailed swoole installation. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template