Change default PHP version

Hey guys,

I need to change the default PHP version of my user and the entire hosting account. I got an issue saying that I can’t upgrade Roundcube because it requires PHP 8.1, while I’m running PHP 8.0 on my account.

command: sudo /usr/local/hestia/bin/v-change-sys-php 8.2

If I change this, I have some WordPress websites and I think this could break them. Is it possible to change the default PHP version and change the mentioned WordPress websites PHP version manually from the dashboard? Or is it possible to restore back the previous working version (8.0) if something goes wrong?

Looking forward to hear back from you guys, thanks in advance!

If your sites require a specific PHP version, edit the web domains and change the backend template from default to the specific php version.

Thank you!

Can I ask you how I can perform the unfinished Roundcube upgrade after I changed the default PHP version now?

Execute this command:

v-add-sys-roundcube

Thank you!

I got this message:

sudo /usr/local/hestia/bin/v-add-sys-roundcube
Error: Installed version (1.7.3) is equal to the available version (1.7.3)

Before that, I executed this:

sudo /usr/local/hestia/bin/v-add-sys-roundcube

And I got this warning:
Warning: Failed to update Roundcube modules
To investigate the issue, run:
COMPOSER_ALLOW_SUPERUSER=1 “/usr/bin/php” “-d disable_functions=” “/home/admin/.composer/composer” --working-dir=“/var/lib/roundcube” update --no-dev --no-interaction --optimize-autoloader

Now, the web mail client is not working at all, unfortunately.

Oops… something went wrong!

An internal error has occurred. Your request cannot be processed at this time.

For administrators: Please check the application and/or server error logs for more information.

Execute the commands and show the output:

sudo -i
COMPOSER_ALLOW_SUPERUSER=1 “/usr/bin/php” “-d disable_functions=” “/home/admin/.composer/composer” --working-dir=“/var/lib/roundcube” update --no-dev --no-interaction --optimize-autoloader
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires guzzlehttp/guzzle ^7.10.0 -> satisfiable by guzzlehttp/guzzle[7.15.2, 7.15.3].
- guzzlehttp/guzzle[7.15.2, ..., 7.15.3] require symfony/deprecation-contracts ^2.5 || ^3.0 -> found symfony/deprecation-contracts[v2.5.0, ..., v2.5.4, v3.0.0, ..., v3.7.1] but it conflicts with your root composer.json require (2.2).

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.

To fix it execute this:

sudo -i
mv /var/lib/roundcube/composer.json /var/lib/roundcube/composer.json.bak
mv /var/lib/roundcube/composer.lock /var/lib/roundcube/composer.lock.bak
mv /var/lib/roundcube/composer.json-dist /var/lib/roundcube/composer.json
source /usr/local/hestia/conf/hestia.conf
COMPOSER_ALLOW_SUPERUSER=1 "/usr/bin/php" "-d disable_functions=" "/home/$ROOT_USER/.composer/composer" --working-dir="/var/lib/roundcube" update --no-dev --no-interaction --optimize-autoloader

It worked like a charm! Take care!