Problem with PHP Version

Discussion in 'General' started by patopattone, Jul 14, 2020.

  1. patopattone

    patopattone New Member

    Hi guys!!! First of all english is no my language so... sorry if I have errors in my text.
    I have a standalone server with Debian 9 and ISPconfig 3.1.15p3. I'm trying to install moodle following the howtoforge tutorial:
    https://www.howtoforge.com/tutorial/how-to-install-moodle-on-ispconfig/
    I'm using Moodle 3.6.10 installer because it requires PHP version 7.0 (the last release Moodle 3.9.1 requires PHP 7.2) When I run the web installer I have an error saying:
    but if I type php -v on my server the output is:
    Why moodle detect version 5.6.40-0+deb8u11?? I have upgraded recently my server from debian 8 to 9... is this the cause??
    Thanks in advance!!
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    That php -v shows what version of PHP is used on the command line. What version websites use is not necessarily the same.
    It may be the PHP 5 is still installed if you did not remove it after dist-upgrade from Debian 8 to 9. See
    Code:
     dpkg --list | grep -i php
    To see what version PHP is default for command line and web use, try these commands:
    Code:
    update-alternatives --config php
    update-alternatives --config php-cgi
    You can change the default with those commands, too.
    If you need both PHP 5 and PHP 7, I suggest installing additional PHP versions for website use, there is tutorial:
    https://www.howtoforge.com/tutorial...bian-8-and-9/#-change-php-version-of-websites
     
    patopattone likes this.
  3. patopattone

    patopattone New Member

    Hi Taleman!! First of all thanks for your quick replay! Yes, I saw that howto and the multiple PHP versions in one server too. But since I'm thinking in upgrade my debian to version 10 soon I'll prefer to do that later with "buster" already installed. I'm going to try the update-alternatives solution.
    Thank you very much.
     

Share This Page