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.
# 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
Is this an apache server? On Apache, phpmyadmin runs via mod_php, which means the correct libapache2.... php Debian package must be installed.
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?
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.
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?
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.