Closed chodges closed 8 years ago
Hi, @chodges.
First thing I notice is that its not showing me the "Server was started successfully. Setup logging to get more details."
No, this message won't appeared, it will remove it from example code to avoid confusing.
Every time I attempt to connect using the Chat widget it throws up the alert "Something wrong. Connection will be closed"
Do you have any errors in the browser console?
No I don't see any errors in the browser at all. But I do see this error in the server logs now:
2016-07-25 17:22:52 [-][-][-][info][chat] Connection is established: 105
in /Applications/MAMP/htdocs/inergycrm/vendor/joni-jones/yii2-wschat/components/Chat.php:41
in /Applications/MAMP/htdocs/inergycrm/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServer.php:138
in /Applications/MAMP/htdocs/inergycrm/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServer.php:84
2016-07-25 17:22:53 [-][-][-][info][chat] Auth request from rid: 105 and chat: 1
in /Applications/MAMP/htdocs/inergycrm/vendor/joni-jones/yii2-wschat/components/Chat.php:107
in /Applications/MAMP/htdocs/inergycrm/vendor/joni-jones/yii2-wschat/components/Chat.php:53
in /Applications/MAMP/htdocs/inergycrm/vendor/cboden/ratchet/src/Ratchet/WebSocket/Version/RFC6455.php:204
2016-07-25 17:22:53 [-][-][-][error][application] ApcCache requires PHP apc extension to be loaded.
in /Applications/MAMP/htdocs/inergycrm/vendor/joni-jones/yii2-wschat/components/Chat.php:76
in /Applications/MAMP/htdocs/inergycrm/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServer.php:158
in /Applications/MAMP/htdocs/inergycrm/vendor/cboden/ratchet/src/Ratchet/Http/HttpServer.php:70
2016-07-25 17:22:53 [-][-][-][info][chat] Connection is closed: 105
in /Applications/MAMP/htdocs/inergycrm/vendor/joni-jones/yii2-wschat/components/Chat.php:67
in /Applications/MAMP/htdocs/inergycrm/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServer.php:149
in /Applications/MAMP/htdocs/inergycrm/vendor/cboden/ratchet/src/Ratchet/Http/HttpServer.php:61
Does the chat server require the APC cache be enabled? I don't have it turned on in Apache. Okay even after turning it on I'm still getting the same error messages.
The chat extension doesn't require the ApcCache
. Please, re-check your cache
component in the configuration.
Okay I was able to get it working. Turns out that I had two versions of PHP. One was running my Apache server and the other was running the chat server. Once I used the same version (with cache enabled - because I need it for other things) it came right up!. Thanks for your help!
@chodges i have same issue with this widget.
echo \jones\wschat\ChatWidget::widget([ 'auth' => true, 'port' => 3000, 'user_id' => Yii::$app->user->getIdentity()->id]);
inside view file i have write above code Every time alert popups with msg "Something wrong. Connection will be closed"
i'm in my local machine with xampp
Can you please help me ?
Hi @mehulvadodariya2012
Unfortunately I haven't used this code in a long long time so I don't remember what I did to get it working. Ultimately I went with a totally different solution: CometChat. Works great. Sorry I can't be of any assistance.
@chodges thanks for quick response :) @joni-jones Are you able to help me ?
@mehulvadodariya2012 configure logging and try to find the original error message in the log.
Hello:
I've set up and created my server chat controller code. I basically copied exactly what you have in your example in the instructions:
I then execute the server using this:
First thing I notice is that its not showing me the "Server was started successfully. Setup logging to get more details."
And here is how I have the chat widget set up:
Every time I attempt to connect using the Chat widget it throws up the alert "Something wrong. Connection will be closed". And I can't see anywhere what could be going wrong. Checked my log files and here is the output:
Does anyone see anything that could be causing this problem?