Php 未捕获错误:类';MyApp\Chat';找不到
未捕获错误:在中找不到类“MyApp\Chat” D:\webs\Live\u Chat\bin\server.php:12 文件目录Php 未捕获错误:类';MyApp\Chat';找不到,php,websocket,composer-php,ratchet,Php,Websocket,Composer Php,Ratchet,未捕获错误:在中找不到类“MyApp\Chat” D:\webs\Live\u Chat\bin\server.php:12 文件目录 - webs - Live_Chat - classes - Chat.php Composer.json { "autoload": { "psr-4": { "MyApp\\": "classes" } }, "require": { "cboden/ratchet": "^0.4.2"
- webs
- Live_Chat
- classes
- Chat.php
Composer.json
{
"autoload": {
"psr-4": {
"MyApp\\": "classes"
}
},
"require": {
"cboden/ratchet": "^0.4.2"
}
}
我已经将Chat.php放在classes文件夹中,并将自动加载JSON的根设置为“classes”
我第一次使用任何web套接字。请帮助。我通过将Chat.php文件放在另一个名为src的文件夹中解决了这个问题。
然后将此代码替换为composer.json“MyApp\”:“src” 您的
composer.json
文件在您的体系结构中的何处?在Live\u聊天文件夹中,它位于根文件夹中