Answer the question
In order to leave comments, you need to log in
Autoload classes via Composer on hosting?
Good afternoon, I recently started studying composer, after googling a little I implemented class autoloading for my project, it works locally, but Fatal error: Class not found
falls out on the hosting
I don’t quite understand how it works at all, and whether it should work, whether something change or some other reason?
.json
{
"name": "artberg",
"require": {},
"autoload": {
"psr-4": {
"App\\": "app/"
}
}
}
require(__DIR__ . '/vendor/autoload.php');
Answer the question
In order to leave comments, you need to log in
Composer's instructions say this:
After adding the autoload field, you have to re-rundump-autoload
to re-generate thevendor/autoload.php file
.
https://getcomposer.org/doc/01-basic-usage.md#auto...
Bottom line:
That is, you need to run the commandcomposer dump-autoload
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question