Home > PHP Framework > Swoole > How to run swoole in php-fpm mode

How to run swoole in php-fpm mode

Release: 2019-12-09 09:35:46
Original
3546 people have browsed it

How to run swoole in php-fpm mode

Most of the modules in swoole can only be used in the CLI command line environment. Only the swoole_client with synchronization blocking can be used in the php-fpm or apache environment.

Sync swoole_client

$client = new swoole_client(SWOOLE_SOCK_TCP); //同步阻塞
$client->connect('127.0.0.1', 9501) or die("connect failed\n");

$client->send(str_repeat("A", 600));
$data = $client->recv(700, 0) or die("recv failed\n");
echo "recv: " . $data . "\n";
Copy after login

(Recommended learning: swoole video tutorial)

The above is the detailed content of How to run swoole in php-fpm mode. 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