Home > Article > PHP Framework > 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=trueThen 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
pecl install swoolePrerequisite 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
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
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!