What is showing when you go into webmin>others>php configuration?
mine is as follows
Configuration file Purpose Actions
/etc/php/7.0/cgi/php.ini PHP 7.0
/etc/php/7.1/cgi/php.ini PHP 7.1
/etc/php/7.2/cgi/php.ini PHP 7.2
/etc/php/7.3/cgi/php.ini PHP 7.3
have you set your default php version to the “highest available” in system settings>server templates>default>php options
Also, are you actually using the “default” template on your virtual server?
You may not be using the default template, therefore you would need to also choose system settings>server templates> “your current virtual server template”>php options
when you say, “when i connect with ssh”, what returns if you just use the built in virtualmin terminal window ( ie >_ ) and type php -v? (my assumption is that it would be same as ssh)
For one of my virtualmin>virtual servers, in terminal window, I get (i have other php versions on the webmin system but not all are automatically available to every virtual serer…it depends on what i want to make available for a particular server template.)
# php -v
PHP 7.3.3-1+0~20190307202245.32+stretch~1.gbp32ebb2 (cli) (built: Mar 7 2019 20:22:46) ( NTS )
Copyright © 1997-2018 The PHP Group
Zend Engine v3.3.3, Copyright © 1998-2018 Zend Technologies
with Zend OPcache v7.3.3-1+0~20190307202245.32+stretch~1.gbp32ebb2, Copyright © 1999-2018, by Zend Technologie
i added the ondrej repository to virtualmin (not sure if that is still what we need to do now or not)
add-apt-repository ppa:ondrej/php
apt update
Then you need to configure virtualmin to use specific php version
virtualmin>virtual server>server configuration>php version
After this then go back into Virtualmin>system settings>your server template (ie default or whatever you are using for current virtual server)>php options and choose php 7.0.30 (or “highest available”)
For example, if your highest available is version php 7.1, you can also set say php 7.1 from command line by doing the following…
update-alternatives --list php
update-alternatives --set php /usr/bin/php 7.1 (your path here might be different…so check what the php path needs to be first (perhaps in file manager)