Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

elo's avatar
Level 3

Symfony required PHP version error

Hey guys I just pulled a project from bitbucket and tried running composer install I got the following error

Your requirements could not be resolved to an installable set of packages.

Problem 1 - Installation request for symfony/css-selector v5.0.4 -> satisfiable by symfony/css-selector[v5.0.4]. - symfony/css-selector v5.0.4 requires php ^7.2.5 -> your PHP version (7.2.4) does not satisfy that requirement. Problem 2

So I updated my PHP version from 7.2.4 to 7.4.4, stopped the wamp server then shut down my system and restarted it. Checked my server configuration and can confirm that the php version updated successfully

 Server Configuration

Apache Version:
    2.4.33  - Documentation
PHP Version:
    7.4.4  - Documentation
Server Software:
    Apache/2.4.33 (Win64) PHP/7.4.4RC1 - Port defined for Apache: 80

Tried running the composer install again and still getting the same error.

The project is running Laravel 6.2 as seen in the composer.json file "laravel/framework": "^6.2",

Any ideas how I can fix this?

0 likes
8 replies
Nakov's avatar

And in your composer.json file do you have:

"require": {
    "php": "^7.2",
     ...

or you changed it to ^7.4?

elo's avatar
Level 3

Yes I have this in my composer.json file

"require": {
        "php": "^7.2",
        "ejarnutowski/laravel-api-key": "^1.0",
        "fideloper/proxy": "^4.0",
        "filp/whoops": "^2.7",
        "laravel/framework": "^6.2",
        "laravel/passport": "^8.4",
        "laravel/tinker": "^2.0",
        "tymon/jwt-auth": "dev-develop"
    },
Nakov's avatar

@elo so change the php version to ^7.4 and check if it works :)

elo's avatar
Level 3

I tried changing it and tried to update the composer.lock file and it threw similar error.

elo's avatar
Level 3

I managed to get it working by doing the following

  1. Select PHP 7.4.4 from the PHP version list in wamp
  2. Run composer update
  3. Run composer install

Now the application is working fine. So it looks like I have to run composer update first when working on projects pulled from a VCS.

Nakov's avatar

@elo no you don't need to first run update, install will do the trick. I think the important part for you was the first step "Select PHP 7.4.4 from the PHP version list in wamp"

elo's avatar
Level 3

I actually changed the php version from 7.2.4 to 7.4.4 before running composer install and it still threw the error. After that, I ran composer update and no error was thrown.

MHelmy's avatar

This needs to change your PHP version use the next:

sudo update-alternatives --config php

Please or to participate in this conversation.