title: PHP Fatal error: Class 'MyApp\Chat' not found in /MyApp/chat-server.php
body: <p>I am trying to run the Ratchet application demo but I can't execute the file </p>
  
  <p>This is my file structure</p>
  
  <pre><code>/var/www/src/MyApp/
  /var/www/src/MyApp/chat.php
  /var/www/src/MyApp/chat-server.php
  </code></pre>
  
  <pre>
  &lt;?php
  use Ratchet\Server\IoServer;
  use MyApp\Chat;
  
  #require "chat.php";
  
      require 'vendor/autoload.php';
  
      $server = IoServer::factory(
          new Chat(),
          8080
      );
  
      $server->run();
  </pre>
  
  <pre><code>/var/www/src/MyApp/composer.json
  </code></pre>
  
  <pre>
  {
      "autoload": {
          "psr-0": {
              "MyApp": "src"
          }
      },
      "require": {
          "cboden/Ratchet": "0.3.*"
      }
  }
  
  </pre>
  
  <p>Vendor Folder is exist in this location</p>
  
  <pre><code>/var/www/src/MyApp/vendor/
  </code></pre>
  
  <p>Whenever I am executing the chat-server file in terminal I got the following error</p>
  
  <pre><code>PHP Fatal error:  Class 'MyApp\Chat' not found in /MyApp/chat-server.php
  </code></pre>
  
  <p><strong>Please help me how to resolve this</strong></p>
  
  <p><em>Note:</em> The complete code details are exist in this page</p>
  
  <p><a href="http://socketo.me/docs/hello-world" rel="noreferrer">http://socketo.me/docs/hello-world</a></p>
  
  <p>This question was asked but still no answer for that question too
  <a href="https://stackoverflow.com/questions/18172707/class-mychat-chat-not-found-in-c-wamp-www-bin-chat-server-php">Class &#39;MyChat\Chat&#39; not found in C:\wamp\www\bin\chat-server.php</a></p>