firebase / php-jwt

PHP package for JWT
BSD 3-Clause "New" or "Revised" License
9.3k stars 1.26k forks source link

Class "Firebase\JWT\Key" not found #563

Closed jmaster03 closed 2 months ago

jmaster03 commented 2 months ago

I don't know exactly why it is showing me this. I've installed the package in the lastest version, I don't know what else to do, please help.

image image

yash30201 commented 2 months ago

Hi @jmaster03 ,

You need to add the composer autoloader at the top of the file. For example:

Let's say composer.json lies in your your $ROOT directory and you script lies in $ROOT/src, then at the top of the file just below <?php:

require_once __DIR__ . '/../vendor/autoload.php';

Please reopen this if you're still experiencing this issue even after requiring the autoloader.