Home  >  Article  >  PHP Framework  >  How to install swoole

How to install swoole

尚
Original
2019-12-10 13:43:552479browse

How to install swoole

##Method 1: PECL installation

Install dependency packages

apt-get install libpcre3 libpcre3-dev

Install swoole

pecl install swoole

Modify PHP configuration php.ini Load swoole

Verify installation and loading:

php -m | grep swoole

Method 2: Source code compilation and installation

1. Download swoole

Download the source code package, decompress it, and switch to the decompression directory

wget -c https://github.com/swoole/swoole-src/archive/v2.0.6.tar.gz

Decompression: tar -zxvf v2.0.6.tar.gz

cd swoole- src-2.0.6/

2. Compile and install

Use phpize to generate PHP compilation configuration

.configure for compilation configuration detection

make Compile make install and install

Execute command:

phpize

./configure

make

make install

Under normal circumstances, it will appear

Installing shared extensions: /usr/lib64/php/modules

Indicates that the swoole.so file is generated in the above directory/usr/lib64/php/modules

3. Modify the configuration file and load the module

Add the swoole module to the PHP configuration file php.ini. Note that the PHP7 module configuration file is separate and only needs to be in /etc/php. Add the module configuration file swoole.ini to the d/ directory to

Enter /etc/php.d/ and execute the command

vim swoole.ini

In swoole.ini Enter

;Enable swoole extension module

extension=swoole.so

Save.

Recommended learning:

swoole video tutorial

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

Statement:
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