我正在尝试基于Pusher构建一个实时聊天应用程序,该指南位于以下网址:https://pusher-community.github.io/real-time-laravel/chat/chat.html
在本地(Windows)上一切正常,但是,当我尝试将其部署到Linux服务器上时,一切都无法正常工作,并且出现以下错误:
nx.connected_components(G)
由ChatController的构造方法引起,尤其是App:make('pusher')行:
Class pusher does not exist {"exception":"[object] (ReflectionException(code: -1): Class pusher does not exist at /home/tgbinfo/public_html/system/applications/erp2/example/vendor/laravel/framework/src/Illuminate/Container/Container.php:779)
[stacktrace]
#0 /home/tgbinfo/public_html/system/applications/erp2/example/vendor/laravel/framework/src/Illuminate/Container/Container.php(779): ReflectionClass->__construct('pusher')
#1 /home/tgbinfo/public_html/system/applications/erp2/example/vendor/laravel/framework/src/Illuminate/Container/Container.php(658): Illuminate\\Container\\Container->build('pusher')
#2 /home/tgbinfo/public_html/system/applications/erp2/example/vendor/laravel/framework/src/Illuminate/Container/Container.php(609): Illuminate\\Container\\Container->resolve('pusher', Array)
#3 /home/tgbinfo/public_html/system/applications/erp2/example/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(759): Illuminate\\Container\\Container->make('pusher', Array)
#4 /home/tgbinfo/public_html/system/applications/erp2/example/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(237): Illuminate\\Foundation\\Application->make('pusher')
#5 /home/tgbinfo/public_html/system/applications/erp2/example/app/Http/Controllers/ChatController.php(23): Illuminate\\Support\\Facades\\Facade::__callStatic('make', Array)
#6 [internal function]: App\\Http\\Controllers\\ChatController->__construct()
在Javascript中,一切仍然很好,我仍然可以获取正确的消息以连接到Pusher。
public function __construct()
{
$this->pusher = App::make('pusher');
$this->user = Session::get('user');
$this->chatChannel = self::DEFAULT_CHAT_CHANNEL;
}
我已经在互联网上阅读并尝试了以下一些操作:
相关的.env代码:
Pusher : State changed : connecting -> connected with new socket ID ####
Pusher : Event sent : {"event":"pusher:subscribe","data":{"channel":"chat-1429-3653"}}
Composer.json:
BROADCAST_DRIVER=pusher
broadcasting.php:
"pusher/pusher-http-laravel": "^4.2",
关于如何解决此错误的任何想法?
答案 0 :(得分:0)
您可能尚未更新对服务器的依赖性。使用“ composer install”命令安装所有依赖项。然后,用户“ composer dump-autoload”重新加载所有依赖项。
答案 1 :(得分:0)
我已经解决了自己的问题,即使运行多个Opt Team
和{{之后,columns_values
中的frm_mwfy_to_te.Subject
和packages.php
文件似乎都没有更新1}}命令。最后,我删除了两个文件,然后再次运行services.php
。新生成的文件包含所需的推入信息Laravel。