'Can't find vendor/autoload.php for Ratchet

I SSH'd to my server and installed Composer and Ratchet. http://socketo.me/docs/install claims all I need to do now is include "require DIR . '/vendor/autoload.php';" at the top of my php file. My page now gets a "failed to open stream: No such file or directory" error.

I've tried various forms of the directory, like "../vendor/autoload.php", but I keep getting the same error. The error reports that it is trying to find it in "/var/www/html/mo/myDomainName.com".

Should I be able to find a vendor folder in my home directory via ftp? I am confused where I'm supposed to be pointing to after my install.



Solution 1:[1]

typically vendor folder for composer is located above /public_html, so if your script is in public_html folder, you'll have to reference this as up one level

example

require_once '../vendor/autoload.php';

Solution 2:[2]

Just add base_path(). You will get the actual path of autoload.php C:\xampp\htdocs\ProjectFolder\vendor\autoload.php

require base_path().'/vendor/autoload.php';

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mike Volmar
Solution 2