After attempting to remove and reinstall a package I'm getting this new error when I try to include('vendor/autoload.php');
Fatal error: Uncaught Error: Class >'ComposerAutoloaderInit7b3c839efeba468a3d595a365ceb8e89' not found in >mypath\vendor\autoload.php:7 Stack trace: #0 mypath\mypage.php(2): include() >#1 {main} thrown in mypath\vendor\autoload.php on line 7
I've tried running composer clearcache before and after reinstalling the package. I deleted C:/Users/MyUsername/AppData/Roaming/Composer and even completely uninstalled Composer. After I reinstalled composer and then reinstalled the package, the error message remains.
What am I missing? I feel like it has a hidden cache somewhere that's breaking this.
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.
Related
I am using the ReallySimpleJWT Library and I have changed the server and reinstalled the libraries with Composer again. Only this library gave an error and I don't understand why.
What could be the problem?
2022/01/03 22:28:51 [error] 2739#2739: *1635 FastCGI sent in stderr:
"PHP message: PHP Fatal error: Uncaught Error: Call to undefined
method ReallySimpleJWT\Token::validateExpiration() in
/var/.......php:23
Line 23:
$result = Token::validateExpiration($token, $secretForToken);
What could be the cause of this error?
Composer:
web2#serve:/var/www/.../panel$ composer require rbdwllr/reallysimplejwt
Using version ^3.1 for rbdwllr/reallysimplejwt
./composer.json has been updated
Running composer update rbdwllr/reallysimplejwt
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Package easyframework/collections is abandoned, you should avoid using it. No replacement was suggested.
Package easyframework/generics is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
36 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
What could be the cause of this error?
The static method your are trying to access on the Token
class does not exist.
I haven't been building applications with laravel in a while, and I'm trying to recall by running the code
composer create-project --prefer-dist laravel/laravel:^7.0 apitestku
at the end of the installation there is an error:
73 package suggestions were added by new dependencies, use composer suggest to see details. Package fzaninotto/faker is abandoned, you
should avoid using it. No replacement was suggested. Package
phpunit/php-token-stream is abandoned, you should avoid using it. No
replacement was suggested.
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump
Fatal error: Interface
'Symfony\Component\HttpKernel\HttpKernelInterface' not found in C:\laravel\apitestku\vendor\laravel\framework\src\Illuminate\Foundation\Application.php on line 29
At first I ignored the problem and ran right away php artisan serve and i got the error
Fatal error: Interface
'Symfony\Component\HttpKernel\HttpKernelInterface' not found in C:\laravel\apitestku\vendor\laravel\framework\src\Illuminate\Foundation\Application.php on line 29
again.
what's causing 'Symfony\Component\HttpKernel\HttpKernelInterface' not found?
i try this solution but not working,
i try solution from Github it's same.
and how to fix it?
After attempting to remove and reinstall a package I'm getting this new error when I try to include('vendor/autoload.php');
Fatal error: Uncaught Error: Class >'ComposerAutoloaderInit7b3c839efeba468a3d595a365ceb8e89' not found in >mypath\vendor\autoload.php:7 Stack trace: #0 mypath\mypage.php(2): include() >#1 {main} thrown in mypath\vendor\autoload.php on line 7
I've tried running composer clearcache before and after reinstalling the package. I deleted C:/Users/MyUsername/AppData/Roaming/Composer and even completely uninstalled Composer. After I reinstalled composer and then reinstalled the package, the error message remains.
What am I missing? I feel like it has a hidden cache somewhere that's breaking this.
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.
I just up updated composer.phar in my local environment.
Now, I get an error that says
Fatal error: Class 'phpseclib\Crypt\AES' not found in /var/www/html/tms2/fuel/core/classes/crypt.php on line 213
How can I fix this?
Do you use 1.8/develop?
Recently it has switched to the composer version.
https://github.com/fuel/fuel/commit/87c1a6feb5deaff63dfa2cb561035ea6c51b724b
Check your composer.json and update it, then do composer update again.
I have setup a basic REST API on my localhost. I have a little bit of a screwed up configuration. I am using MAMP with PHP 5.5.3 and installed Laravel via
composer create-project laravel/laravel heartbet --prefer-dist
I have everything working peachy on my localhost and it all seems in order with autoload. However when colleagues are pulling my GIT repo with the laravel CMS in it, it seems that the autload goes bad and it can't find the classes anymore. I am getting the following error on their machines:
PHP Fatal error: Uncaught exception 'ReflectionException' with message 'Class FatalErrorException does not exist' in /Users/claes/co/heartbet/public/api/vendor/laravel/framework/src/Illuminate/Exception/Handler.php:316\nStack trace:\n#0 /Users/claes/co/heartbet/public/api/vendor/laravel/framework/src/Illuminate/Exception/Handler.php(316): ReflectionParameter->getClass()\n#1 /Users/claes/co/heartbet/public/api/vendor/laravel/framework/src/Illuminate/Exception/Handler.php(300): Illuminate\Exception\Handler->hints(Object(ReflectionFunction), Object(ReflectionException))\n#2 /Users/claes/co/heartbet/public/api/vendor/laravel/framework/src/Illuminate/Exception/Handler.php(237): Illuminate\Exception\Handler->handlesException(Object(Closure), Object(ReflectionException))\n#3 /Users/claes/co/heartbet/public/api/vendor/laravel/framework/src/Illuminate/Exception/Handler.php(145): Illuminate\Exception\Handler->callCustomHandlers(Object(ReflectionException))\n#4 [internal function]: Illuminate\Exception\Handler->handleException(Object(Reflecti in /Users/claes/co/heartbet/public/api/vendor/laravel/framework/src/Illuminate/Exception/Handler.php on line 316
I checked all my autloader and composer and everything seems to be in order. I tried
composer dump-autoload
composer install --no-scripts
Also tried something like composer dump-autoload -o without any success. I am still pretty new to the autloading scene and laravel.
Does anybody have any tips on how i can resolve this issue? I find it hard to know where to look for the problem exactly and other answers that i read up on so far all seem to suggest the above two to resolve any directory errors.
Thanks and cheers!
Kenneth