Why my autoload.php of composer doesn't work?

Matteo Calò picture Matteo Calò · Aug 19, 2013 · Viewed 100k times · Source

I have a project, I use Composer and i import many thing by it... i require the autoload.php in my index (the root of project) and istead Slim, Mongo, Twig work very well. But when I call a class of Respect/Validation it doens't work; if I simply use Respect/Validation the error is:

Class 'Respect\Validation\Validator' not found in (path of file when i need it).

if I try to require also here the autoload.php the errors are:

**Warning**: require_once(vendor/autoload.php): failed to open stream: No such file or directory in (path of file when i need it)

**Fatal error**: require_once(): Failed opening required 'vendor/autoload.php' (include_path='.;C:\xampp\php\PEAR') in (path of file when i need it)

Answer

ciruvan picture ciruvan · Aug 19, 2013

Try using php composer dump-autoload. It may fix that problem.