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

rehman_ali's avatar

Unable to run a laravel project due to php verison 7.2.5

I am trying to set a laravel project on local. The composer.json file has following versions

"require": {
       "php": "^7.2.5",
       "fideloper/proxy": "^4.2",
       "fruitcake/laravel-cors": "^1.0",
       "guzzlehttp/guzzle": "^6.3",
       "laravel/framework": "^7.0",
       "laravel/tinker": "^2.0",
       "laravel/ui": "^2.0",
       "fzaninotto/faker": "^1.9.1"
   }

and my PHP version is 8.1.10 When I try to install or update composer it shows problems. Simply changing the PHP in composer.json to 8.1.10 does not work.

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

  Problem 1
    - Root composer.json requires php ^7.2.5 but your php version (8.1.10) does not satisfy that requirement.

2nd Problem when I try to update composer with 8.1.10, it shows a lot of errors. Only posting the one that is highlighted red

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

How can I resolve this issue?

0 likes
2 replies

Please or to participate in this conversation.