Questions tagged [swoole]

Swoole is an open source async framework for PHP.

Swoole is an event-driven asynchronous and concurrent networking communication framework with high performance written only in C for PHP.

The network layer in Swoole is event-based and takes full advantage of the underlying epoll/kqueue implementation, making it really easy to serve thousands of connections.

More information can be found on GitHub and the Swool website.

92 questions
0
votes
1 answer

PHP-Swoole error accept() failed, Error: Too many open files[24]

I have installed php/swoole on my server and configured it using Laravel swoole Now The problem is everything works fine until total requests per second number increase more than 1000 requests. Swoole will log an error and not responding to user…
Mr.Apr
  • 66
  • 1
  • 6
0
votes
0 answers

PHP can not make directory in daemon mode

I'm using swoole/HTTP server, and I set it on daemon:1 to make it work on the background but there is a problem. When I try to make a directory in this mode, PHP can't do that, and there is no swoole error log.
0
votes
1 answer

Dont know how to load page dynamically with Swoole

Hello developper friends. I'm trying to make old website working with swolle http server but i'm stacking. I follow starting tutorial but can't find way to go head.
0
votes
1 answer

Swoole WebSocket Server - communication between client

I'm trying to understand how are we supposed to manage client in Swoole Websocket Server. I've MyServer who extends from Swoole\WebSocket\Server, I store in a property the client list, but it seems every single client can only see his own list (with…
iow
  • 29
  • 4
0
votes
0 answers

Swoole error 9009 message from Server process timer, not a Worker process callback?

I use Swoole as a WebSocket server. Once per second I need to broadcast a message to all connected WS clients. Naive approach: I set a server timer $server->tick() prior to launching a server: $this->server->tick(1000, function () { $message =…
Serge
  • 1,531
  • 2
  • 21
  • 44
0
votes
0 answers

PHP Singleton as CallBack for HTTP Request in HTTP Server

I want to know if there will be any synchronization / concurrency related issues ? if we serve a "request" event (in HTTP Server like swoole) using a "Singleton" as "callback to the request event". In other words the callback that serves the request…
Fakhar Anwar
  • 295
  • 1
  • 3
  • 20
0
votes
1 answer

Cannot Connect to socket.io laravel swoole

let socket = io.connect('http://127.0.0.1:1215/', {transports: ['websocket']}); i serve my laravel application with php swoole php artisan swoole:http start i always get this error in console WebSocket connection to…
0
votes
2 answers

How to send a message to ReactPHP/Amp/Swoole/etc. from PHP-FPM?

I'm thinking about making a worker script to handle async tasks on my server, using a framework such as ReactPHP, Amp or Swoole that would be running permanently as a service (I haven't made my choice between these frameworks yet, so solutions…
BenMorel
  • 34,448
  • 50
  • 182
  • 322
0
votes
1 answer

Redirect eventsource request to server port that runs swoole

I'm trying to improve my php application using Swoole for fetch notifications. As swoole runs in PHP's built in server, I'm trying to redirect my 'host/notification' requests to port 9501 where Swoole is running without success. My code in .htaccess…
user7262544
0
votes
2 answers

Docker can see image.png file, but no image is displayed in browser

I'm playing around learning Docker and Swoole. Running a Docker container that contains 2 files and an empty directory. Upon accessing the HTTP server in browser, the image is not displayed (getting the broken image icon). I've already tried a PNG…
Garrett Burke
  • 123
  • 2
  • 9
0
votes
1 answer

Class 'Swoole\MySQL' not found

Async Mysql Client of Swoole in my PHP Project for which I am trying to use Swoole MySQL Class of PHP but I am getting class not found error while executing the code. Below is the code snippet I was trying to execute:
Akshay Khale
  • 8,151
  • 8
  • 50
  • 58
0
votes
1 answer

How can I do right routes and controllers with swoole in laravel?

I installed everything according to the instructions and the project started: I read wiki on Github,and on point 7 was this rout example: Websocket::on('connect', function ($websocket, Request $request) { // called while socket on connect …
0
votes
1 answer

Swoole server only can be used in PHP CLI mode

I am using Swoole server and slim framework, especially this library: Slim Swoole Link I have followed the tutorial, and gives me this error: Fatal error: Swoole\Server::__construct(): swoole_server only can be used in PHP CLI mode. in…
Ratchet
  • 223
  • 1
  • 5
  • 13
0
votes
0 answers

Swoole make failed ubuntu16.04

I am trying to install SWOOLE on my Ubuntu-16.04 I tried this sudo pecl install swoole But am getting a long list of errors(Skipped some lines) In file included from /tmp/pear/temp/swoole/php_swoole.h:156:0, from…
Sumithran
  • 6,217
  • 4
  • 40
  • 54
0
votes
2 answers

Swoole send websocket data from server to client

Hi all! I use swoole for WebSockets. I create clietn part: