Please remember that there is nothing magic or weird about how this message is printed. We are doing this straightforward check:
if (!function_exists('ssh2_connect'))
That is to say, if PHP itself reports that the ssh2_connect
function, provided by the SSH2 PHP extension, is not present we throw an error, as without this function we cannot connect to an SSH / SFTP server. Which is to say, when you see this error message the only explanation is that the PHP environment you are running the backup under does not, in fact, have the SSH2 PHP extension enabled, or its functions are explicitly disabled in PHP's configuration (through disable_functions
).
What you don't seem to realize, however, is that which PHP version is used and which configuration is used depends greatly on how you are trying to run the backup and/or that your server has many PHP version with at least two different configuration sets for each version installed on it.
So, let's start by checking how are you running the backup.
If you were running it from the front-end of your site (legacy front-end backup, remote JSON API) it would indeed be a weird problem because PHP would have the SSH2 extension installed and enabled, but at the same time reporting its functions as not present on the site. This does not hold any water. I know of other sites on SiteGround using SFTP to store their backups in, so that's not the case. This means that your systeminfo.php
file is quite useless in troubleshooting since you're not running the backup from the frontend of the site to begin with.
If you are running it from the back-end of your site do note that it might be using a different PHP version with a different configuration. That's why Joomla has System, Information, System Information, PHP Information where you can see the phpinfo()
page of the PHP version used in the backend of your site. If you're using a different PHP version than 8.2.28 in the backend of your site please ask SiteGround to tell you how you can change that; since they're using a custom hosting control panel I don't have readily available instructions to give you or link you to.
If you are running it from CLI please note that the PHP CLI configuration can and usually is different to the configuration of the same PHP version using in the web (either as an Apache module, as a FastCGI script, or through the PHP FastCGI Process Manager a.k.a. PHP-FPM). Moreover, when you have a CRON job which version of PHP you are using depends on which PHP binary you are using in the command line; you need to ask SiteGround to provide the correct path to PHP 8.2 – and remember to update it next year when you move to PHP 8.3; this is a boring but necessary part of maintaining a site. It is, therefore, possible to have an entirely different PHP version and/or an entirely different PHP configuration than what you see on the web, thus trying to run the backup under a PHP version and/or configuration which does not have the PHP SSH2 extension enabled.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!