I'm trying to install some modules through the composer.

After I enter the name of the version for installation, an error is displayed, indicating that the current version of php is lower than the version that the module requires to work.

Our site works on php7, although when using from the console, using the php -v command shows version 5.3

How can I configure my default php to be version 7 via the console?

  • Use the php7 command instead of php or something? - andreymal Nov.
  • one
    For PHP to be version 7.0, you just need to install PHP of the required version. Or turn to psychics who find out what distribution kit you have. Well, or if you say that you have a Windows, then even a psychic will not help. - zalex

1 answer 1

Choose a version for cli

In gentoo

eselect php set cli php7.2 

In debian / ubuntu

 update-alternatives --set php /usr/bin/php7.2