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

dipta_dey's avatar

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2".

At CPanel i get this error . but at local server xampp everything okay. Please help me. my composer.json

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "php": "^7.3|^8.0",
        "barryvdh/laravel-dompdf": "^1.0",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "kreait/laravel-firebase": "^4.0",
        "laravel/framework": "^8.75",
        "laravel/sanctum": "^2.11",
        "laravel/tinker": "^2.5"
    },
    "require-dev": {
        "facade/ignition": "^2.5",
        "fakerphp/faker": "^1.9.1",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^5.10",
        "phpunit/phpunit": "^9.5.10"
    },
    "autoload": {
        "psr-4": {
            "App\": "app/",
            "Database\Factories\": "database/factories/",
            "Database\Seeders\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "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
}

0 likes
10 replies
vincent15000's avatar
Level 63

@dipta_dey Are you sure that your webhosting is really set with PHP 8.x ? The webhostings often propose several PHP versions and by default they set an earlier PHP version. Have you checked that the running PHP version is really 8.x ? Perhaps you have to set the wanted version from your CPanel.

sj's avatar

What is the PHP version on both systems?

1 like
aeadedoyin's avatar

For anyone using nginx, check your nginx conf file for the project to make sure it is running the same php version used by composer.

For anyone using valet check your current project' valet php version, to make sure its the same as the one used by composer, to change php version: valet use php[x.x]

2 likes

Please or to participate in this conversation.