First install phpstudy. For this step, you can go to http://lamp.phpstudy.net to install it. The whole process will take about 50-90 minutes. It depends on your CPU. CPU The better the performance, the faster (Recommended learning: swoole video tutorial)
Then download the swoole extension download address https://codeload.github.com/swoole/swoole-src /tar.gz/swoole-1.7.9-alpha
Extract tar -xvzf swoole-src-swoole-1.7.9-alpha.tar.gz
cd swoole-src-swoole-1.7.9-alpha sudo vi /root/.bashrc
at the end Add a line of export PATH=/phpstudy/server/php/bin:$PATH
Save and exit
Run the following command on the command line to reload the variable sudo source /root/ .bashrc
Then execute the command phpize
to display the result root@hainuio-X401A:~/swoole-src-swoole-1.7.9-alpha# phpize Configuring for: PHP Api Version : 20100412 Zend Module Api No: 20100525 Zend Extension Api No: 220100525
Run ./configure
Run make
Run sudo make install
Then sudo vi /phpstudy/server/php/etc/php.ini
Add extension=swoole.so in front of extension=php-xxx.dll
Run the command sudo phpstudy restart to restart apache to load the php configuration
Run the command php -m to check if there is a swoole module
The above is the detailed content of How to install swoole extension in phpstudy. For more information, please follow other related articles on the PHP Chinese website!