Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Error: Declaration of Pimple\\Psr11\\ServiceLocator #178

Open
ablears opened this issue Apr 21, 2022 · 6 comments
Open

Fatal Error: Declaration of Pimple\\Psr11\\ServiceLocator #178

ablears opened this issue Apr 21, 2022 · 6 comments

Comments

@ablears
Copy link

ablears commented Apr 21, 2022

composer require cedaro/satispress:1.0.3 results in the following:

Problem 1
- Root composer.json requires cedaro/satispress 1.0.3 -> satisfiable by cedaro/satispress[v1.0.3].
- cedaro/satispress v1.0.3 requires psr/container ^1.0 -> found psr/container[1.0.0, 1.1.0, 1.1.1, 1.1.2] but the package is fixed to 2.0.2

composer require cedaro/satispress:1.0.3 -W:

Lock file operations: 3 installs, 1 update, 0 removals

  • Locking cedaro/satispress (v1.0.3)
  • Locking cedaro/wp-plugin (v0.4.0)
  • Locking composer/semver (3.3.2)
  • Downgrading psr/container (2.0.2 => 1.1.2)

This then results in a fatal error:

PHP Fatal error: Declaration of Pimple\Psr11\ServiceLocator::get(string $id) must be compatible with Psr\Container\ContainerInterface::get($id) in /Users/admin/Sites/barltd/vendor/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php on line 59

@thefrosty
Copy link

This has been a common issue around different plugins that have been moving to the PHP >= 7.4 supported Psr Container ^2.0.x.

I have run into this issue in a few of my personal packages too. The only resolution is to have SatisPress bump it's depemdency to support PHP >= 7.4 and then update psr/container to ^2.0.2.

See changes: php-fig/container@1.1.2...2.0.2

@thefrosty
Copy link

Funny, I ended up running into this issue again today with a project, and was able to resolve it via Composers use as feature. In my projects composer require I included: "psr/container": "dev-master as 1.1.2". This pulls in latest 2.0.x but tells your project it's version 1. Just be careful about strict type comparisons.

@lirdis
Copy link

lirdis commented Jun 21, 2022

Using Satispress on a regular wp site and getting this error... How exactly can I implement the suggested solution inside within the plugin files..? Currently have this error showing up:
Fatal error: Declaration of Pimple\Psr11\ServiceLocator::get(string $id) must be compatible with Psr\Container\ContainerInterface::get($id) in /home/443710.cloudwaysapps.com/wxbfkrannf/public_html/wp-content/plugins/satispress/vendor/pimple/pimple/src/Pimple/Psr11/ServiceLocator.php on line 38

The only way to get the website back up is to disable the plugin... But... I kinda need it :-)
Will appreciate any idea anyone might have for me :)

@lirdis
Copy link

lirdis commented Jun 26, 2022

Anyone? Anything..??

@alesub
Copy link

alesub commented Jul 20, 2022

I'm also having this issue after downloading the latest release and uploading it as a standard plugin.

@lkraav
Copy link

lkraav commented Jul 7, 2024

This is a duplicate of #171, although thus far no solution movement there either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants