Search code examples
phplaravelcomposer-phpshared-hostingcyber-panel

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


I am trying to run composer install on my server,(which is a CentOS based machine) and getting this weird error, Your requirements could not be resolved to an installable set of packages.

Though output of my phpinfo() in my project folder gives php version as 7.4, but running php -v command shows it as 7.1, Please let me know how to fix it.

Edit: composer -vvv about is showing following- Running 1.10.15 with PHP 7.1.33 on Linux


Solution

  • Ok, I figured it out, The problem was with php-cli as mentioned. Instead of updating to a newer version or removing old version I created an alias for the binary file of new version of PHP and provided full path to the composer, so my command now looks like this: [alias(path to new version of PHP)] [alias(path to composer)] [composer command]..