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.
Related
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?
I did not use the sudo when installing doctrine in symfony
So this is what i got..
The "https://flex.symfony.com/aliases.json" file could not be downloaded: failed to open stream: Connection refused https://flex.symfony.com/aliases.json could not be fully loaded, package information was loaded from the local cache and may be out of date
to fix that i did this curl -XGET https://flex.symfony.com/aliases.json
and then i installed composer require symfony/orm-pack composer require --dev symfony/maker-bundle
The problem is that it wont add any db config in the env file....
and when i do the composer require doctrine
i get this
Pontuss-MacBook-Air:cauldron_overflow Pontus$ composer require doctrine
Using version ^1.0 for symfony/orm-pack
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.4.*"
Nothing to install or update
Package zendframework/zend-code is abandoned, you should avoid using it. Use laminas/laminas-code instead.
Package zendframework/zend-eventmanager is abandoned, you should avoid using it. Use laminas/laminas-eventmanager instead.
Generating autoload files
34 packages you are using are looking for funding.
Use thecomposer fundcommand to find out more!
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Executing script cache:clear [OK]
Executing script assets:install public [OK]
Executing script security-checker security:check [OK]
So why wont it add the correct data to my env files?
Please any advice
When you install a recipe it installs some sample data to your .env.dist file.
This is only for the first run when you install the recipe. After the install you can do what you want and remove that variables and use it from your Docker for example. So perhaps i don't understood your problem because you wrote that you don't want db config in your env file and in the last line you write that it won't add it.
https://symfony.com/doc/current/configuration.html
I know you use flex but there are some good examples how to use and how to do it. Flex should use the DotEnv-Component.
The last thing is your error (https://flex.symfony.com/aliases.json). I think you have firewall that blocks the load of the aliases file. So you have to check that first. That call should work if you run it in your browser or with curl. Otherwise it could give a problem to load all components.
I solved the issue by removing doctrine and reinstall the package :) and now the env file looks like it should :)
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.
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'm trying to install illuminate/html in my Laravel 5.3 app:
$ composer require "illuminate/html":"5.0.*"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package illuminate/html is abandoned, you should avoid using it. Use laravelcollective/html instead.
Writing lock file
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize
PHP Fatal error: Call to undefined method Illuminate\Foundation\Application::bindShared() in /var/www/qa-laravel/vendor/illuminate/html/HtmlServiceProvider.php on line 36
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined method Illuminate\Foundation\Application::bindShared()
Script php artisan optimize handling the post-update-cmd event returned with error code 255
Installation failed, reverting ./composer.json to its original content.
I did change the vendor path if that caused something to go wrong in composer.json:
{
...
"config": {
"preferred-install": "dist",
"vendor-dir": "../vendor"
}
}
Classes are being loaded OK, I just can't install this new package. Any obvious reason for this error?
That package is not compatible with Laravel 5.3. The ->bindShared() function was removed as of 5.1 and is now ->singleton().
Further, the Form Helper package was removed for a reason; it doesn't save any time and introduces complications that aren't necessary. No purpose in using it; remove it.