Home > PHP Framework > Swoole > body text

How to turn on swoole

(*-*)浩
Release: 2019-12-07 13:50:41
Original
2809 people have browsed it

How to turn on swoole

Swoole is an extension of PHP that can be installed and enabled through PHP extension.

# Local Installation (Recommended Learning: Swoole Video Tutorial )

Laradock

## If so, taking Laradock as an example, you need to set the following two lines of configuration values ​​​​to true in the .env in the laradock directory:

WORKSPACE_INSTALL_SWOOLE=true
PHP_FPM_INSTALL_SWOOLE=true
Copy after login

Then run docker-compose build php-fpm workspace to rebuild the Docker container and the build is completed. Then restart these two containers, enter the workspace container, run php -m to check whether Swoole is installed successfully. If the extension list contains swoole, it means the installation is successful.

Windows/Mac

If it is installed on a local Windows/Mac system, directly execute the following command to install the interface:

pecl install swoole
Copy after login
Copy after login

Prerequisite Yes pecl command is available in the system path. Then run php -m and see that the extension list contains swoole, which means the installation is successful.

Online installation

If you are installing on a server, take the Ubuntu system as an example and install it by executing the following command:

pecl install swoole
Copy after login
Copy after login

Then locate the location of the php.ini file through php -i | grep php.ini, open the configuration file , and append the following content at the end of the file:

[swoole]
extension=swoole.so
Copy after login

Save and exit, Run php -m in the terminal. If you see swoole included in the extension, the installation is successful.

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

Related labels:
source:php.cn
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