Class Firebase\JWT\JWT not found

As per the documentation, you need to include the autoloader. E.g., in your php file: require __DIR__ . ‘/vendor/autoload.php’; But… typically your vendor folder would be at the same level than your html folder (the one where you are serving content). E.g.: – Project root — vendor — html —– index.php Then in your index.php … Read more

How to use Composer to autoload classes from outside the vendor?

The src directory would be in your project root. Its on the same level as vendor directory is. If you define “autoload”: { “psr-4”: { “DG\\Munchkin\\”: “src/DG/Munch/” } } this will not load classes from /var/www/html/xxx/vendor/yyy/src/DG/Munch, like you stated. Because your project structure is: /var/www/html/ +- /xxx (project) – composer.json +- /src +- DG +- … Read more

but these conflict with your requirements or minimum-stability

Add minimum-stability and prefer-stable to your composer.json (not composer.lock): { “name”: “coderstephen/slack-client”, “keywords”: [“slack”, “api”, “realtime”], “license”: “MIT”, “description”: “A better Slack client, with RTM API support”, “authors”: [{ “name”: “Stephen Coakley”, “email”: “[email protected]” }], “require”: { “php”: “>=5.5”, “devristo/phpws”: “dev-master”, “evenement/evenement”: “2.0.*”, “guzzlehttp/guzzle”: “~6.0”, “react/event-loop”: “^0.4.1”, “react/promise”: “^2.2” }, “require-dev”: { “phpunit/phpunit”: “~4.6”, “fzaninotto/faker”: … Read more

I’m getting error “Class ‘Predis\Client’ not found” in Laravel 5.2

First download the REDIS to your system (if you haven’t already installed it). Go to the folder where you have downloaded the redis and run this command: cd your-redis-folder-name make Go to your project directory and install composer: composer require predis/predis Go to your .env file and add Queue driver: QUEUE_DRIVER=redis use Mail::queue() to send … Read more

How to always use ignore-platform-reqs flag when running composer?

It’s recommended to fake php version, rather than ignore platform requirements. Add “platform”:{“php”:”5.5″} to your ~/.composer/config.json or use composer config -g -e to edit it. An example of sufficient config to fake php version: { “config”: { “platform”:{ “php”:”5.5″ } } } It may have much more options though. UPDATE: starting from v2.3.0 you can … Read more

Remove composer

During the installation you got a message Composer successfully installed to: … this indicates where Composer was installed. But you might also search for the file composer.phar on your system. Then simply: Delete the file composer.phar. Delete the Cache Folder: Linux: /home/<user>/.composer Windows: C:\Users\<username>\AppData\Roaming\Composer That’s it.

Composer: file_put_contents(./composer.json): failed to open stream: Permission denied

I had this problem to install laravel/lumen. It can be resolved with the following command: $ sudo chown -R “$(id -un)” “$(composer config –global home)” What this command does: Execute as privileged user (root) the command to change file owner (not group) to the current user (by name) recursively to the COMPOSER_HOME directory. As the … Read more