in my project I have imported by composer respect/validator
. Now, I have a file (login.php) in a subfolder of subfolder where I need it.
The Respect/Validation's documentation says write:
<?php
use Respect\Validation\Validator as v;
obviously I must require my vendor/autoload.php
(autogenerate Composer's file), I do it in index.php of my project in the root. Well, it work for every packages (Slim, twig...) but not for Respect/Validation, I try also with other package into my login.php but it's the same.
the error is: Fatal error: Class 'Respect\Validation\Validator' not found
so, i try also to require here the autoload.php and the results:
Warning: require_once(vendor/autoload.php): failed to open stream: No such file or directory
Fatal error: require_once(): Failed opening required 'vendor/autoload.php' (include_path='.;C:\xampp\php\PEAR')
I think that the problem is with autoload.php or with the path. Because I should not need the autoload in login.php or however when I require it, it should not change the error...