How to work in the console with alternate versions of PHP

How to use alternate versions of PHP in the console

After connecting to the server via SSH or via terminal on the Virtual Hosting service, you can find out what PHP versions are installed for the sites.

To use the terminal, go to the panel from your personal account and go to AdvancedTerminal.

file

root_directory_site php -v
[f72651@hostde31 ~]$ cd public_html/testfrnx.ru
[f72651@hostde31 testfrnx.ru]$ php -v
PHP 8.2.22 (cli) (built: Aug 8 2024 13:36:58) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.22, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.22, Copyright (c), by Zend Technologies

file

[f72651@hostde31 ~]$ php -v
PHP 7.2.34 (cli) (built: Mar 28 2023 15:46:55) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with the ionCube PHP Loader + ionCube24 v10.4.5, Copyright (c) 2002-2020, by ionCube Ltd.
    with Zend OPcache v7.2.34, Copyright (c) 1999-2018, by Zend Technologies

In this output you will see that there is a major version of PHP 8.2 for the site and 7.2 for the main account.

Info

If you have any difficulties or need help, please create a support request via ticket system and we will be happy to help you.

Need help?Our engineers will help you free of charge with any question in minutesContact us