I am working on a Laravel project. My composer.json
file is like below.
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.1.3",
"barryvdh/laravel-dompdf": "0.8.6",
"doctrine/dbal": "^2.10",
"fideloper/proxy": "^4.0",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"maatwebsite/excel": "^3.1",
"phpoffice/phpspreadsheet": "^1.21",
"propaganistas/laravel-phone": "4.2.3",
"spatie/db-dumper": "^2.15",
"timehunter/laravel-google-recaptcha-v3": "~2.2.16",
"webup/laravel-sendinblue": "~2.0"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^7.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"repositories": {
"packagist.org": {
"type": "composer",
"url": "https://packagist.org"
}
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\Foundation\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r "file_exists('.env') || copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}
Initially I was using PHP 8.1
. I was getting below error.
Problem 1
- Root composer.json requires php ^7.1.3 but your php version (8.1.10) does not satisfy that requirement.
Problem 2
- laravel/framework[v5.8.0, ..., 5.8.x-dev] require php ^7.1.3 -> your php version (8.1.10) does not satisfy that requirement.
- Root composer.json requires laravel/framework 5.8.* -> satisfiable by laravel/framework[v5.8.0, ..., 5.8.x-dev].
After that I changed my PHP version to 7.0
. Then I am getting below error while I am running composer update
command.
Composer 2.3.0 dropped support for PHP <7.2.5 and you are running 7.0.33-57+ubuntu18.04.1+deb.sury.org+1, please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.
How can I run composer update
command in this project ?
2
Answers
I think you need to install php^7.1.3 after that install you need to change environment path for php^7.1.3 after running command
Yes you need to install xampp 7.1.30. Before this uninstall your old xampp. And delete xampp file in c disk.