Change PHP version

I feel like I must have missed something. In Server Config -> Web Server, I have checked off PHP-5.6, PHP-7.2 and the default PHP7.4. Ive tried changing the the user CLI to 7.2. and even though it saves and shows it’s 7.2, it doesn’t seem to have taken. There doesn’t appear to be any way to change the PHP version per website. and even though I have assigned the “PHP CLI version” (under each user), to 7.2 the Configure webs server screen shows all users using 7.4 and 7.4 is greyed out. I thought I would be able to allow users to change PHP version per website. I can’t figure out how. I have tried restarting the server.

CLI version is linked to the user and can only be set at user lever. Login/logout is required for the user. Before changes takes effect

Via PHP template you are able to change your php version per website see below

Nope That always only says default. Even though I have logged in and out a few times now.

EDITL: OK i see the list of templates, but setting them doesn’t seem to change the version.

I’m not able to reproduce any issues with changing php version here. For testing: Create a index.php file with:

<?php
phpinfo();

Then change the version and refresh the page. If you still get the same php version, please share your os, version and used installation string (your setup, with or without apache2 and so on) with us.

I figured out what I did but not sure how to make it work. I copied the PHP-7_2.tpl to PHP-7_2-test.tpl and when I try to use that new template, nothing changes. I suspect it’s got to do with the name I’ve given it. Have I misunderstood the naming convention. I thought it was recommended to rename the templates when changes are made to them, so that they are not changed on upgrade.

Have a look at the following post for the naming convention of the template file:

You can also check

https://docs.hestiacp.com/admin_docs/server_management.html#how-can-i-change-settings-for-a-specific-domain

I have exactly the same problem.
Running Ubuntu 20 LTS with the newest Hestia Version (installed yesterday).
I have activated several PHP versions.
But no matter which one I select within the dropdown of the backend template (PHP-FPM) I always end up with “default”.
And then the website is always running with PHP 7.4

One more info:
I just found out, that changing the PHP-FPM works with the websites attached to the admin.
But it does not work for webs attached to a normal user.

The solution is just above your message.

Sorry, but I don’t get it.
How can it help to have a template named different as the existing ones if I can’t choose them on the GUI anyway?
BTW I have made a copy of the PHP_7.2.tpl within /data/templates/web/php-fpm.
But if I choose this, I do get an error 5.

Please provide a working example either using the user.ini or via a special template.

v-add-web-php should install the correct template. No need to make it your self

But the templates already do exist
v-list-sys-php display this list:
VERSION

5.6
7.2
7.4
8.0

The problem ist, that I can’t set a specific PHP version for a specific website.

This only works for the websites administered by the admin, websites under a normal user can not be changed. The dropdown always stays at “default” (at backend-template (php-fpm)).

Login as admin en then:

1st Icon

Then you are able to alter php version for an domain

Will change in 1.4.0

Many thanks!
“Login as” does the trick.

Then you can change the version as desired.

Can I just pop this topic instead of a new one? :slight_smile:

Idk when it happened, probably a little bit earlier, but found out only now.
Can’t change php version starting today, phpinfo() always returns the version that I had previously, and I can’t change it anymore. In panel version is changed, but not on site.

My system is Debian 10.10, Hestia v1.4.6

Please upgrade to 1.4.7, there was a bug in restart the related services. Also please open a new thread instead reviving an 5 months old one :slight_smile:.