I have installed multiple version of PHP 5.6, 7.2, 7.3, 7.4 and 8.0 with 7.4 set as the default. I tried to switch to different version for some projects running on older version, doing this:
sudo update-alternatives --set php /usr/bin/php5.6
Then restart the apache by doing:
sudo service apache2 restart
And also did if switching to other version
sudo update-alternatives --config php
Then restarted Apache
But when I open to http://localhost/phpmyadmin
again which was working recently, now its throwing error 500 then did check the error on /var/log/apache2/error.log
and it says:
PHP message: PHP Warning: Unsupported declare 'strict_types' in /usr/share/php/PhpMyAdmin/MoTranslator/Loader.php on line 23\nPHP message: PHP Parse error: syntax error, unexpected '?' in /usr/share/php/PhpMyAdmin/MoTranslator/Loader.php on line 116\n`
And created a file with phpinfo
it it and printed the PHP version, it says php 5.6 but in CLI, by doing php -v
it says php 7.4, below is the screenshot of the phpinfo()
Any help, ideas, are greatly appreciated.