Heyo,
I have followed every step of the Hello World! tutorial, but can't get past Instantiation. I run it through the command prompt and the following error appears:
php bin\chat-server.php
Fatal error: Class 'MyApp\Chat' not found in C:\path\to\install\betabin\chat-server.php on line 8
File tree and composer.json can be found here: http://pastebin.com/xEDwVBg0
Just wondering if I missed something or interpreted something wrong. Thank you~
Are you including vendor/autoload.php in chat-server.php?
This? require dirname(DIR) . '/vendor/autoload.php'; If so, yes.
Can you post the code to your chat-server.php and Chat.php?
I got the same error..
according to this: http://stackoverflow.com/questions/16868942/ratchet-basic-chat-application-giving-error-failed-opening-required
"php composer.phar update" helped
btw someone should write exactly filestructure to the hello world app, it is not explicitly given where should be chat-server located..
it should be easy to write down:
appfolder/composer.json
appfolder/bin/chat-server.php
appfolder/src/MyApp/Chat.php
btw, i am referring to tutorial from here: http://socketo.me/docs/hello-world
Thank you scholtz, the update command fixed it. I might suggest you add a little note about using the update command after editing composer.json as well.
I'm out of town for four days. When I get back I'll update the website documentation with the recently revised way (composer require cboden/ratchet) to install a package as well as a tree structure.
Thanks a lot. I have the same problem. When I execute php composer.phar update, I fixed it.
My folder tree:
โ ws tree -L 3
.
โโโ bin
โย ย โโโ chat-server.php
โโโ composer.json
โโโ composer.lock
โโโ composer.phar
โโโ MyApp.php
โโโ src
โย ย โโโ MyApp
โย ย โโโ Chat.php
โโโ vendor
โโโ autoload.php
โโโ cboden
โย ย โโโ ratchet
โโโ composer
โย ย โโโ autoload_classmap.php
โย ย โโโ autoload_namespaces.php
โย ย โโโ autoload_psr4.php
โย ย โโโ autoload_real.php
โย ย โโโ ClassLoader.php
โย ย โโโ installed.json
โโโ evenement
โย ย โโโ evenement
โโโ guzzle
โย ย โโโ common
โย ย โโโ http
โย ย โโโ parser
โย ย โโโ stream
โโโ react
โย ย โโโ event-loop
โย ย โโโ socket
โย ย โโโ stream
โโโ symfony
โโโ event-dispatcher
โโโ http-foundation
โโโ routing
22 directories, 13 files