Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Swoole on Linux system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "Linux system how to install Swoole", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "Linux system how to install Swoole" this article.

Introduction to Swoole: Swoole enables PHP developers to write high-performance and high-concurrency TCP, UDP, Unix Socket, HTTP, WebSocket and other services, so that PHP is no longer limited to the Web domain.

The maturity of Swoole4 protocol brings PHP into an unprecedented period, providing a unique possibility for performance improvement.

Swoole can be widely used in Internet, mobile communications, cloud computing, online games, Internet of things (IOT), car Internet, smart home and other fields.

Detailed steps for installing Swoole on Linux system: experimental environment:

Virtual machine: 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 for swoole installation files

Cd / data mkdir rpm2) Open the github address of swoole: https://github.com/swoole/swoole-src/releases

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

Wget-c https://github.com/swoole/swoole-src/archive/v4.3.4.tar.gz (4) decompress:

Tar-xzvf v4.3.4.tar.gz5) check the environment and dependency requirements and check out the swoole website: https://wiki.swoole.com/.

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

Check out the preparation for compilation and installation: https://wiki.swoole.com/wiki/page/6.html.

Before installation, you must make sure that the following software is installed on the system

Php-7.0 or later gcc-4.8 or later make autoconf pcre (CentOS system can execute the command: yum install pcre-devel) check command:

Php-v check php version gcc-v check gcc version rpm-qa make check if make is installed. Rpm-qa autoconf checks to see if autoconf is installed. Rpm-qa pcre checks to see if pcre is installed. (6) configuration compilation:

Phpize & &\. / configure\-- enable-coroutine\-- enable-openssl\-- enable-http2\-- enable-async-redis\-- enable-sockets\-- enable-mysqlnd & &\ make clean & & make if an error is reported:

Configure: error: Cannot find php-config. Please use-- with-php-config=PATH finds the directory of php and 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 add swoole extension

Use php-ini to view the location of the php.ini and execute an example of the result:

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 php.ini

Vim / usr/local/php/etc/php.ini add:

Extension=swoole.so save exit.

(9) verify that the installation is successful

Php-- ri swoole to view the version:

Php-- ri swoole | grep Version above is all the content of this article "how to install Swoole on Linux system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report