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

phayes0289's avatar

Cannot install Package because is requires Greater Than PHP7, But I have PHP 8.2/

I am trying to installed the SDK for pusher using:

composer require pusher/pusher-http-laravel

It immediately returns the the following error:

Cannot use pusher/pusher-http-laravel's latest version v4.2.4 as it requires php ^7.0 which is not satisfied by your platform.

Problem 1
    - pusher/pusher-http-laravel 1.0.0 requires illuminate/contracts ~5.0 -> found illuminate/contracts[v5.0.0, ..., 5.8.x-dev] but these were not loaded, likely because it conflicts with another require.
    - pusher/pusher-http-laravel[1.1.0, 2.0.0, ..., 2.1.0] require illuminate/contracts 5.0.*|5.1.* -> found illuminate/contracts[v5.0.0, ..., 5.1.x-dev] but these were not loaded, likely because it conflicts with another require.
    - pusher/pusher-http-laravel 2.2.0 requires illuminate/contracts 5.1.* || 5.2.* -> found illuminate/contracts[v5.1.1, ..., 5.2.x-dev] but these were not loaded, likely because it conflicts with another require.
    - pusher/pusher-http-laravel[2.2.1, ..., 2.3.0] require php ^5.5.9 || ^7.0 -> your php version (8.2.0) does not satisfy that requirement.
    - pusher/pusher-http-laravel 2.4.0 requires php ^5.6.4 || ^7.0 -> your php version (8.2.0) does not satisfy that requirement.
    - pusher/pusher-http-laravel[dev-master, dev-laravel-6, 2.5.0, 3.0.0, ..., 3.1.0, v4.0.0, ..., 4.2.x-dev] require php ^7.0 -> your php version (8.2.0) does not satisfy that requirement.
    - Root composer.json requires pusher/pusher-http-laravel * -> satisfiable by pusher/pusher-http-laravel[dev-master, dev-laravel-6, 1.0.0, 1.1.0, 2.0.0, ..., 2.5.0, 3.0.0, 3.1.0, v4.0.0, ..., 4.2.x-dev].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require pusher/pusher-http-laravel:*" to figure out if any version is installable, or "composer require pusher/pusher-http-laravel:^2.1" if you know which you need.

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

Not only does my composer file require greater than PHP 8.0.2, but I also confirmed that I am running PHP 8.2.

This is my composer file:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "php": "^8.0.2",
        "aws/aws-sdk-php": "^3.276",
        "barryvdh/laravel-dompdf": "^2.0",
        "bugsnag/bugsnag-laravel": "^2.0",
        "cviebrock/eloquent-sluggable": "^9.0",
        "edsdk/flmngr-server-php": "^1.6",
        "geocodio/geocodio-library-php": "^1.5",
        "guzzlehttp/guzzle": "^7.2",
        "haruncpi/laravel-user-activity": "^1.0",
        "intervention/image": "^2.7",
        "laminas/laminas-feed": "^2.21",
        "laravel-notification-channels/apn": "^5.0",
        "laravel-notification-channels/webpush": "^7.1",
        "laravel/framework": "^9.11",
        "laravel/sanctum": "^2.14.1",
        "laravel/tinker": "^2.7",
        "laravel/ui": "^3.4",
        "laravel/vonage-notification-channel": "^3.0",
        "livewire/livewire": "^2.12",
        "maatwebsite/excel": "^3.1",
        "minishlink/web-push": "^8.0",
        "rap2hpoutre/laravel-log-viewer": "^2.3",
        "silviolleite/laravelpwa": "^2.0",
        "simplesoftwareio/simple-qrcode": "^4.2",
        "spatie/laravel-activitylog": "^4.7",
        "spatie/laravel-comments": "^1.4",
        "spatie/laravel-comments-livewire": "^1.4",
        "spatie/laravel-medialibrary-pro": "^2.0.0",
        "spatie/laravel-permission": "^5.5",
        "spatie/laravel-settings": "^3.2",
        "spatie/pdf-to-image": "^2.2",
        "staudenmeir/laravel-adjacency-list": "^1.0",
        "twilio/sdk": "^7.15"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.9",
        "barryvdh/laravel-ide-helper": "^2.12",
        "fakerphp/faker": "^1.9.1",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^6.1",
        "phpunit/phpunit": "^9.5.10",
        "spatie/laravel-ignition": "^1.0"
    },
    "autoload": {
        "psr-4": {
            "App\": "app/",
            "Database\Factories\": "database/factories/",
            "Database\Seeders\": "database/seeders/"
        },
        "files": [
            "app/Helpers/Helpers.php"
        ]
        
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://satis.spatie.be"
        }
    ],
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

What am I missing? This makes no sense to me.

0 likes
3 replies
LaryAI's avatar
Level 58

It seems like there's a misunderstanding in the error message you're seeing. The error message indicates that the pusher/pusher-http-laravel package requires a PHP version of ^7.0, which means any version of PHP 7, but not necessarily PHP 8. However, since you're using PHP 8.2, you should be able to install a version of the package that supports PHP 8.

Here's what you can do to resolve the issue:

  1. Ensure that you are running the correct version of PHP in your terminal. Sometimes, the PHP version in the terminal might differ from the one used by your web server. You can check the PHP version in your terminal by running:
php -v
  1. If the PHP version is correct, try to require a specific version of the pusher/pusher-http-laravel package that is compatible with PHP 8. You can check the package's documentation or its composer.json file on GitHub to find out which version supports PHP 8.

  2. If you find that a newer version supports PHP 8, you can specify that version in your composer require command. For example:

composer require pusher/pusher-http-laravel:^5.0

Replace ^5.0 with the actual version number that supports PHP 8.

  1. If you're still having trouble, you can try updating your composer.json file to allow for a wider range of PHP versions, but this is generally not recommended as it could lead to compatibility issues. Instead, always try to use the specific version of the package that is meant for your PHP version.

  2. After making changes to your composer.json, run the following command to update your dependencies:

composer update
  1. If none of the above solutions work, you may want to check if there are any other conflicting packages in your composer.json that might be preventing the installation of pusher/pusher-http-laravel.

Remember to always back up your composer.json and composer.lock files before making changes to your dependencies.

Please or to participate in this conversation.