Home >PHP Framework >Swoole >How to install swoole
##Method 1: PECL installation
Install dependency packagesapt-get install libpcre3 libpcre3-devInstall swoole
pecl install swooleModify PHP configuration php.ini Load swooleVerify installation and loading:
php -m | grep swoole
Method 2: Source code compilation and installation
1. Download swooleDownload the source code package, decompress it, and switch to the decompression directorywget -c https://github.com/swoole/swoole-src/archive/v2.0.6.tar.gzDecompression: tar -zxvf v2.0.6.tar.gzcd swoole- src-2.0.6/2. Compile and installUse phpize to generate PHP compilation configuration.configure for compilation configuration detectionmake Compile make install and installExecute command:phpize./configuremake make installUnder normal circumstances, it will appearInstalling shared extensions: /usr/lib64/php/modulesIndicates that the swoole.so file is generated in the above directory/usr/lib64/php/modules3. 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 commandvim swoole.ini In swoole.ini Enter ;Enable swoole extension module extension=swoole.soSave.Recommended learning:
The above is the detailed content of How to install swoole. For more information, please follow other related articles on the PHP Chinese website!