N
N
naonma2014-03-11 18:48:40
Yii
naonma, 2014-03-11 18:48:40

How to attach phpdaemon to Yii2?

Hello! We decided to write a website in yii2 using web sockets. Faced a problem - we can't connect yii2 to web sockets (or vice versa).
In logs: W#23156 crashed by error 'Class 'Yii' not found' at /var/www/app/frontend/phpdaemon/WebSocketApp.php:22
How to solve the problem?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
A
Andrew, 2014-03-11
@kaasius

Call autoloader loader from Yii?

N
naonma, 2014-03-11
@naonma

And how will he load his classes then?

S
Sergey, 2014-03-11
Protko @Fesor

they don't need to be linked. The web socket server must be a stand-alone application. You need to organize communication between it and the yii application (via rest, sockets or RabbitMQ/ZeroMQ).
In general, in your case, it seems to me that it is easier to use services like pusher .

S
Sergey, 2014-03-11
@begemot_sun

php and websocket are incompatible things. Use Erlang, Go, node.js, at worst Python.

K
kolesnevg, 2014-03-11
@kolesnevg

try nginx_push_stream_module

P
Pavel Shorokhov, 2015-10-25
@comm1x

Article about "How to connect Yii to phpDaemon" Yii2 is
screwed in almost the same way, you will need to dig a little in the onReady () method.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question