Composer does not find my php 7.2 on server.

Discussion in 'Installation/Configuration' started by pilecarls8, Aug 23, 2020.

  1. pilecarls8

    pilecarls8 New Member

    I have an Debian 8 on server but and has got added PHP 7.2.
    I have set up a site and choosed php7.2 as php version.
    I have installed composer and got no error.
    I log in as root on server adn move to the directory that I want the app to be installed on and I get several error swhen I run a composer command for installing and app, it is all related to php version, it states that php 7 or newver is not avaliable.
    How can I fix this?

    Example error :

    - phpunit/phpunit 6.5.9 requires php ^7.0 -> your PHP version (5.6.40) does not satisfy that requirement.
    Last edited: Aug 26, 2020
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    My guess is you have installed PHP 7.2 compiling yourself and not by installing the .deb packages from a repository?
    So the default version OS uses is still the old PHP, and composer uses that. Try:
    update-alternatives --config php
    update-alternatives --config php-cgi
    I hope you are not using ISPConfig on that host, since it breaks if you change the PHP version.
    I do not compile PHP myself, it is so complicated that I do not trust I can get it working. Instead I apt-get install from Ondre Sury repository, but looks like he no longer provides packages for Debian 8 Jessie.

Share This Page