简体   繁体   中英

Laravel kreait/laravel-firebase install failed

I am working on a project and tried to install firebase package using:

composer require kreait/laravel-firebase

But it returns different errors:

Using version ^4.1 for kreait/laravel-firebase
./composer.json has been updated
Running composer update kreait/laravel-firebase
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - lcobucci/jwt[4.1.5, ..., 4.2.x-dev] require ext-sodium * -> it is missing from your system. Install or enable PHP's sodium extension.
    - kreait/laravel-firebase 4.1.0 requires kreait/firebase-php ^6.0 -> satisfiable by kreait/firebase-php[6.0.0, ..., 6.x-dev].
    - kreait/firebase-php[6.0.0, ..., 6.x-dev] require lcobucci/jwt ^4.1 -> satisfiable by lcobucci/jwt[4.1.0, ..., 4.2.x-dev].
    - Root composer.json requires kreait/laravel-firebase ^4.1 -> satisfiable by kreait/laravel-firebase[4.1.0].

To enable extensions, verify that they are enabled in your .ini files:
    - D:\xampp\php\php.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-sodium` to temporarily ignore these required extensions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require kreait/laravel-firebase:*" to figure out if any version is installable, or "composer require kreait/laravel-firebase:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

How can i fix this problem?. Is there any solution for this?

You need to install/activate sodium goto, D:\xampp\php\ and open file php.ini .

Now search for sodium

You will see ;extension=sodium

Remove semi colon ; and save file.

Now reload apache, and run the composer again.

For me, I just follow this steps.

step 1.

You need to install/activate sodium goto D:\xampp\php\ and open file php.ini.

Now search for sodium

You will see;extension=sodium

Remove semi colon; and save file.

Now reload apache, and run the composer again.

step 2.

delete composer.lock file

composer require kreait/laravel-firebase --with-all-dependencies

The answer by Murad Ali worked for me. The only change was I accessed the php.ini file via Xamp the windows app. To edit go to config then select php.ini from the list and edit from there. Scroll to Line 953

the php.ini file xamp server screen and

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM