Home > PHP Framework > Swoole > How to connect swoole with PHP

How to connect swoole with PHP

(*-*)浩
Release: 2019-12-12 10:58:01
Original
2152 people have browsed it

How to connect swoole with PHP

swoole is an asynchronous, parallel, high-performance network communication engine for PHP. It is written in pure C language and provides an asynchronous multi-threaded server in PHP language and an asynchronous TCP/UDP network client. , asynchronous MySQL, asynchronous Redis, database connection pool, AsyncTask, message queue, millisecond timer, asynchronous file reading and writing, asynchronous DNS query.

Swoole has built-in Http/WebSocket server/client and Http2.0 server. (Recommended learning: swoole video tutorial)

Go to the GitHub homepage to download the Swoole extension source code, address: https://github.com/swoole/swoole-src After downloading, follow the standards The PHP extension compilation method is compiled and installed.

Usually

phpize
./configure
make install
Copy after login

After compilation and installation, modify php.ini and add extension=swoole.so to enable the swoole extension. It can also be loaded dynamically through dl('swoole.so'). It is recommended to modify php.ini.

Download the swoole_framework source code, address: https://github.com/swoole/framework. Just place it in your workspace directory.

swoole_framework is PHP code, you only need to require/include, no compilation and installation are required.

Configuration./configure As above, if your environment has multiple php environments, you should find the current environment using your

find / -iname php-config
./configure --with-php-config= 上边的查找结果就行
Copy after login
make
make install
Copy after login

Then modify the php.ini file and add extension=swoole.so

The above is the detailed content of How to connect swoole with PHP. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template