PHPmyadmin not running default php version (7.3) how to change?

Discussion in 'General' started by MikaelWinther, Jan 28, 2021.

  1. MikaelWinther

    MikaelWinther New Member

    I need help,
    I have muliple PHP versions installed on my server (7.2/7.3/7.4/8.0), and it is working fine for the sites on the server,
    and the default PHP version set in the OS (Debian SID) is PHP7.3
    How do i change the PHP version that phpmyadmin is running under,
    because when i access the /phpmyadmin i get the following error:
    ----------------------------------------------
    PHP 7.1.3+ is required.
    Currently installed version is: 5.6.40-0
    ----------------------------------------------
    Please help.
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    What is the output of
    Code:
    php -v
    ?
     
  3. MikaelWinther

    MikaelWinther New Member

    # php -v
    PHP 7.3.26-1+0~20210112.74+debian10~1.gbpd78724 (cli) (built: Jan 12 2021 13:59:47) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.3.26, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.26-1+0~20210112.74+debian10~1.gbpd78724, Copyright (c) 1999-2018, by Zend Technologies
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Is this an apache server? On Apache, phpmyadmin runs via mod_php, which means the correct libapache2.... php Debian package must be installed.
     
  5. MikaelWinther

    MikaelWinther New Member

    Apache2 yes.
    so "apt-get install mod_php7.3" or how?
    The phpmyadmin runs on php 5.6.40 and if i install an old version of phpmyadmin that supports php 5.6.40 then it works,
    but i would like to change the PHP version phpmyadmin runs on to 7.3 or 7.4, how do i do that?
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Search for the package name with e.g:

    apt-cache search libapache | grep php

    there should be only one package in the list that you get for php 7.3. Install this package with apt then.
     
  7. MikaelWinther

    MikaelWinther New Member

    Installed with:
    apt-get install libapache2-mod-php7.3
    and restarted apache2 servuce.
    but the phpmyadmin still runs with PHP 5.6.40
    How do i change it?
     
  8. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Code:
    sudo a2enmod php7.3
     
    MikaelWinther likes this.
  9. MikaelWinther

    MikaelWinther New Member

    Sorry. Reboot of the server did the trick, after also removing libapache2-mod-php5 thank you.
     
    Th0m likes this.
  10. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    FWIW, Debian SID is not a supported OS, and the default php version in SID right now is 7.4.

    You can use mod_php like that, but nowadays it's better to uninstall all mod_php versions and switch to using php-fpm with mod_mpm_event, so you can support http2. Use eg. "a2enconf php7.3-fpm" to set one (not multiple) default php-fpm version.
     

Share This Page