I've just installed php 8 (following https://rpms.remirepo.net/wizard/) on my VPS running CentOS 7. While in the CLI it shows that PHP 8 is available, when I serve a webpage with phpinfo() it still shows php 7.
PHP 8.0.7 (cli) (built: Jun 1 2021 18:43:05) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.7, Copyright (c) Zend Technologies
Also when I check with composer it shows php 8
Running 2.1.3 (2021-06-09 16:31:20) with PHP 8.0.7 on Linux / 3.10.0-1127.18.2.el7.x86_64
But via a webpage displaying phpinfo() it shows
PHP Version 7.2.34
The commands I ran (from the remi wizard) to install PHP are:
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install yum-utils
yum install php80
Next I tried restarting apache with 'sudo systemctl restart httpd.service' but this didn't resolve. I suspect that somehow I need to still switch between both PHP versions but I don't know if that's the cause or how to do so.
Some more info
$ which php
/usr/bin/php
$ whereis php
php: /usr/bin/php /usr/lib64/php /etc/php.ini /etc/php.d /usr/include/php /usr/share/php /usr/share/man/man1/php.1.gz
whereis php80
php80: /usr/bin/php80
$ httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built: Nov 16 2020 16:18:20
My search further (thnx t3ln3t) brought me to the apache config files, which references a php7 config file which then points to 'libphp72.so'. So I am guessing that eventually that needs to point to php8. But although php8 is installed, I don't see a libphp80.so file.
Thank you for any guidance on what I should do next to make the apache config point to the newly installed php8 version.