Answer the question
In order to leave comments, you need to log in
Why is Composer Autoload not loading classes?
I started working with Composer and refactored my project. Decided to load my classes via autoload. The composer.json has this code:
{
"require": {
"guzzlehttp/guzzle": "~6.0"
},
"autoload": {
"psr-4": {
"App\\Classes\\": "App/Classes"
}
}
}
<?php
use GuzzleHttp\Client;
use GuzzleHttp\Stream\Stream;
namespace App\Classes;
class Instagram {
....
<?php
//ini_set('display_errors',1);
require 'vendor/autoload.php';
$Instagram = new App\Classes\Instagram('270534082.1e03566.c8abaeb7073349a8a146716dbf79c65d');
?>
Fatal error: Class 'App\Classes\Instagram' not found in index.php on line 6
composer install, composer dump-autoload
Answer the question
In order to leave comments, you need to log in
Solved a problem. It was necessary to replace the file name with a reversible class.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question