linux is installed successfully check swoole

Linux installation Swoole

Practice environment:

VM: Oracle VM VirtualBox 5.2.4 r119785 (Qt5.6.2).

System: CentOS Linux release 7.6.1810 (Core) x86_64-Minimal version.

(1) create a directory to put swoole installation files

cd /data

mkdir rpm

2) Open swoole the github Address: https://github.com/swoole/swoole-src/releases

(3) to find the required version, such as 4.3.4, download:

wget -c https://github.com/swoole/swoole-src/archive/v4.3.4.tar.gz

(4) decompression:

tar -xzvf v4.3.4.tar.gz

5) Check environmental requirements and dependencies, see swoole official website: https://wiki.swoole.com/ .

  View reliance, https://wiki.swoole.com/wiki/page/7.html .

  View compile and install preparations: https://wiki.swoole.com/wiki/page/6.html .

  Before installing the system must ensure that the following software is already installed

php-7.0 或更高版本

gcc-4.8 或更高版本

make

autoconf

pcre (CentOS系统可以执行命令:yum install pcre-devel)

Check the command:

php -v 查看php版本

gcc -v 查看gcc版本

rpm -qa make 检查是否安装make。

rpm -qa autoconf 检查是否安装autoconf。

rpm -qa pcre 检查是否安装pcre。

(6) configured to compile:

phpize && \

./configure\

--enable-coroutine \

--enable-openssl \

--enable-http2 \

--enable-async-redis \

--enable-sockets \

--enable-mysqlnd && \

make clean && make

If the error:

configure: error: Cannot find php-config. Please use --with-php-config=PATH

Find php directory, and find the location of php-config, for example:

phpize && \

./configure --with-php-config=/usr/local/php/bin/php-config \

--enable-coroutine \

--enable-openssl \

--enable-http2 \

--enable-async-redis \

--enable-sockets \

--enable-mysqlnd && \

make clean && make

(7) Installation:

make install

(8) php extensions add swoole

  Use php --ini to view the location of php.ini, the results example:

Configuration File (php.ini) Path: /usr/local/php/etc

   Loaded Configuration File: /usr/local/php/etc/php.ini

   Scan for additional .ini files in: /usr/local/php/conf.d

   Additional .ini files parsed: (none)

  Edit your php.ini

vim /usr/local/php/etc/php.ini

Add to:

extension=swoole.so

  Save and exit.

(9) verify that the installation was successful  

php --ri swoole

View Version:

php --ri swoole | grep Version

You can see has been successfully installed.

These are the linux swoole check whether the successful installation details

Learn more information, please visit:

Tencent T3-T4 standard boutique Daquan PHP Architect tutorial directory, as long as you read the guarantee pay rises to a higher level (continually updated)

Above hope to help everyone, many PHPer always encounter some problems and bottlenecks in the advanced time, write more business code no sense of direction, I do not know from where to start to ascend, which I compiled some information, including but not limited to: a distributed architecture, highly scalable, high-performance, high-concurrency, server performance tuning, TP6, laravel, YII2, Redis , Swoole, Swoft, Kafka, Mysql optimization, shell scripts, Docker, micro-services, Nginx, etc. more advanced knowledge required for advanced dry goods can be free for everyone to share , need to be added to my official group here .

Published 265 original articles · won praise 36 · views 10000 +

Guess you like

Origin blog.csdn.net/weixin_43814458/article/details/105343431