Uncaught Error: Class 'ComposerAutoloaderInit' not found
Your autoloader seems to be on an unfit state.
Just regenerate it.
composer dump-autoload
If this doesn't work (although it should), simply remove the whole vendor
directory, and run composer install
again.
Clearing composer's cache has no effect on this, since this is only the one used by composer to avoid downloading files all over again, not a project level cache.
PHP Uncaught Error: Class not found using composer autoload
I think you need to match your file name to your class name so it should be ExtractLinkCommand.php
, otherwise the composer autoloader won't find it.
Composer/Doctrine 2 Class 'ComposerAutoloaderInit...' not found in vendor/autoload.php
You are not supposed to provide that file (you mention that file is taken from a tutorial). This is automatically generated by Composer as part of the update process, and gets also generated during install. The name of the class is dynamically generated, and you will never match the current autoloader class name.
If you somehow committed that file in your own source control, then you should get rid of it. Don't use code that restores that file to a previous state.
Class not found error with PHP Composer Autoload
So as you said, you're posting to a script called CrearCompeticion.php
that is located within the public/
directory.
This means that whatever code is present in index.php
, including require '../vendor/autoload.php';
, is not executed in this case.
So in your case (you said you followed a Laracast but don't seem to be using a Laravel app setup), you'll want to add require __DIR__ . '/../vendor/autoload.php';
on top of CrearCompeticion.php
as well, which should do the job.
Composer does not recognize Class Fatal error: Uncaught Error: Class Not Found
There isn't a BinanceApiContainer
class in the global namespace.
use Larislackers\BinanceApi\BinanceApiContainer;
// ...
$bac = new BinanceApiContainer('<your_key>', '<your_secret>');
PHP : Fatal error: Uncaught Error: Class 'abc\abc' not found in demo.php
You can edit your compose.json file and add following
{
"autoload": {
"psr-4": {
"abc\\": "",
}
}
}
do
composer update
and test
check https://getcomposer.org/doc/04-schema.md#psr-4 for more details
Related Topics
Simple PHP Mail Function Not Working on Amazon Server Ec2
Send Email by Email Class in Codeigniter with Gmail
Best Way to Check a Empty Array
Laravel Change Connection Dynamically
Passing an Instance Method as Argument in PHP
Multiple Radio Button Array for PHP Form
How to Remove an HTML Element Using the Domdocument Class
Escaping Curl @ Symbol with PHP
PHP Variable Variables with Array Key
Getting Imagegrabscreen to Work
Php: What If I Call a Static Method in Non-Static Way
Is $_Server['Http_Referer'] Safe
How to Add a PHP Simplexmlelement to Another Simplexmlelement