[Swoole] ubuntua AnSo swoole

Official website tutorial: https://wiki.swoole.com/wiki/page/6.html (can see the official do not waste time)

 

The official gave three methods of installation:

A novice compiler example

Second, advanced a full compilation example

Three, pecl a key installation fool

As a senior Daniel, selected herein is a first method for mounting

(As for why do not fool? Oh! Would not it be exposed my IQ?

Mainly due to the very beginning of the installation did not see! ! ! See when almost Bahrain! ! ! )

 

text:

First  https://github.com/swoole/swoole-src/releases  find the download link (official may be updated in real time)

For example, here is the link to find  https://github.com/swoole/swoole-src/archive/v4.2.1.tar.gz

#操作前先切换root用户
sudo su
#下载文件包
wget https://github.com/swoole/swoole-src/archive/v4.2.1.tar.gz

#解压 x:解压 z:tar.gz格式需要 v:显示过程 f:下个参数为包名  -C:解压到指定目录
tar -xzvf v4.2.1.tar.gz /usr/local/swoole

#进入安装目录
cd /usr/local/swoole
#开始安装
sudo phpize (ubuntu 没有安装phpize可执行命令:sudo apt-get install php-dev来安装phpize)

sudo ./configure

Here it may report a mistake to say " the configure: error: the Find of Can not  PHP . PHP--config Please use --with-config = the PATH "

#这里的/usr/local/php 是php的安装路径,请按需替换
./configure --with-php-confit=/usr/local/php/bin/php-config

Then perform the installation, re-emphasized to use root privileges to perform

make 

make install

。。。

...

。。。

After friends on Bahrain

In /use/local/php/etc/php.ini years plus

extension=swoole.so

Under restart php-fpm, lnmp integrated tools I use to restart the entire tool gets the job done

php -m | grep swoole
或
php -r 'phpinfo();' | grep swoole

If you can see the result of that is, the installation is successful swoole

 

If before the installation process is not an error, but still can not see the extension of words

First in swoole installation folder under swoole.so search

In /use/local/php/etc/php.ini in the

extension=swoole.so

Change

#后面的值是搜索结果
extension=/路径/swoole.so

Then restart php-fpm, call it a day

Published 35 original articles · won praise 18 · views 370 000 +

Guess you like

Origin blog.csdn.net/TXX_c/article/details/82773888