PHP's asynchronous, parallel, high-performance network communication engine, written in pure C, provides the PHP language for asynchronous multithreaded servers, asynchronous TCP/UDP network clients, asynchronous MySQL, asynchronous Redis, database connection pooling, Asynctask, Message Queuing, millisecond timers, Asynchronous file read-write, asynchronous DNS query. The Swoole has built-in Http/websocket server-side/client, Http2.0 server-side/client.
The Swoole has a built-in asynchronous non-blocking, multi-threaded network IO server. PHP programmers only need to deal with event callbacks, without having to worry about the underlying. NginxUnlike the Tornado Node.js All-Asynchronous framework, Swoole supports both full-async and synchronous.
In addition to the asynchronous IO support, Swoole has designed multiple concurrent data structures and IPC communication mechanisms for PHP multi-process mode, which can greatly simplify the work of multi-process concurrent programming. These include the rich features of concurrent atomic counters, concurrent Hashtable,channel,lock, interprocess communication IPC, etc.
Swoole supports the built-in coprocessor starting with version 2.0, which enables asynchronous programs to be implemented using fully synchronized code. PHP code does not need to add any additional keywords, the underlying automatic scheduling, asynchronous implementation.
Swoole can be widely used in the Internet, mobile communications, enterprise software, online games, Internet of things, car networking, smart home and other fields. Use PHP+Swoole as a network communication framework, can make enterprise IT research and development team's efficiency greatly improve, more focus on the development of innovative products.
Swoole is free free software for open source, the license agreement is Apache2.0 . Enterprise and individual developers are free to use Swoole code, and modifications made on the swoole can be used for commercial products without open source (note: The original author's copyright notice must be retained)
Installation steps:
1.wget https://github.com/swoole/swoole-src/archive/swoole-1.7.6-stable.tar.gz
2.tar ZXVF swoole-1.7.6-stable.tar.gz
3.CD swoole-1.7.6-stable.tar.gz
4.phpize (Final execution success is shown below)
5../configure (the final execution succeeds as shown below)
6.make && make install (Final execution success is shown below)
Finally, modify the php.ini file input extension=swoole.so
Finally restart Nginx and PHP
Service Nginx Restart
Service PHP-FPM Restart
Centos7 Installing the PHP swoole extension