My composer.json file
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.3||^8.0",
"brian2694/laravel-toastr": "^5.5",
"fideloper/proxy": "^4.0",
"intervention/image": "^2.4",
"laravel/framework": "5.6.*",
"laravel/tinker": "^1.0",
"ext-gd": "*"
},
"require-dev": {
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"@php -r "file_exists('.env') || copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"@php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\Foundation\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true,
"allow-plugins": {
"kylekatarnls/update-helper": true
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
I am getting an error
Problem 1
– laravel/framework[v5.6.0, …, 5.6.x-dev] require php ^7.1.3 -> your php version (8.2.4) does not satisfy that requirement.
– Root composer.json requires laravel/framework 5.6.* -> satisfiable by laravel/framework[v5.6.0, …, 5.6.x-dev].
What should I do
I am trying to run it on localhost
3
Answers
It’s seem’s your php version is not compatible with your laravel version
your laravel version:5.4
your php version :8.2
you need php version 7 or upgrade your laravel
you can install older xampp with 7 php version
you install php version 8.2 , but your laravel version:5.4
you need to change your php version 7 or you can install laravel 9,10
The error shows that your Laravel project requires a
PHP version of at least 7.1.3
, but you havePHP 8.2.4
installed.to solve this issue you have to
Upgrade your Laravel version to a version that supports
PHP 8.2.4.
In yourcomposer.json
filechange like this
If you prefer to stick with
Laravel 5.6
, you can downgrade your PHP version to one that satisfies the requirement. You can install a different PHP version using aversion manager
likephpbrew
or by using apackage manager
likeapt
on Ubuntu orbrew
on macOS.If you don’t have specific reasons to stick with
Laravel 5.6
, feel free to upgrade to a more recentLaravel version
that supportsPHP 8.2.4
.