Home  >  Article  >  Backend Development  >  How to install swoole extension in php

How to install swoole extension in php

王林
王林Original
2019-12-02 09:49:533964browse

How to install swoole extension in php

1. Installation

# wget https://github.com/swoole/swoole-src/archive/swoole-1.7.6-stable.tar.gz
# tar zxvf swoole-1.7.6-stable.tar.gz
# cd swoole-1.7.6-stable 
# phpize 
# ./configure 
# make  && make install**

Tips:

Sometimes we generate PHP extension modules After restarting, you will find that phpinfo is not loaded successfully. This is because the compiled version of swoole does not have debug mode, and the current version of our php installation has debug mode, so we only need to recompile swoole and php, and add --enable-debug when recompiling swoole is enough.

 find / -name php-config
./configure --enable-debug --with-php-config=这里放入上一步命令中显示的绝对路径

2. PHP loads the swoole extension

php -i | grep php.ini

Query the path where php.ini is located Enter the path and add extension=swoole.so to php.ini.

How to install swoole extension in php

3. Restart the service

service php-fpm restart 
service nginx restart

4. Test

View the phpinfo information, as shown below:

How to install swoole extension in php

## Recommended related article tutorials:

Getting started with php development

The above is the detailed content of How to install swoole extension in php. 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