Page 1 of 1

Change Default PHP Version

Posted: Thu Jan 14, 2021 10:01 pm
by pepsi
First of all, I did attempt to search for this but I believe that the search function of the forums are broken at the moment. No matter what word(s) you search for, you get this:

Code: Select all

The following words in your search query were ignored because they are too common words: default php.
You must specify at least one word to search for. Each word must consist of at least 3 characters and must not contain more than 14 characters excluding wildcards.
That said, I have changed the default version on my system's CLI so that when I run `php -v`, I get the 7.4 PHP version that I am wanting. However when deploying sites on VestaCP, the `phpinfo` of those sites show it using PHP 8. I am wanting to change the default version that Vesta uses from PHP 8 to PHP 7.4.

I have already seen solutions where people mentioned uninstalling php-* packages, but I'm not wanting to uninstall any of my PHP packages. I'm simply wanting to change the default PHP version. Any ideas on how to accomplish this? I'm using VestaCP with Apache on CentOS 7.

Edit: I should also add that `php --ini` shows the configuration file as being the PHP 7.4 ini file:

Code: Select all

# php --ini
Configuration File (php.ini) Path: /etc/opt/remi/php74
Loaded Configuration File:         /etc/opt/remi/php74/php.ini
Scan for additional .ini files in: /etc/opt/remi/php74/php.d