I have this code in a simple way to connect SFTP and upload files for a CMR, until php 7.4 everything works, now with PHP 8.0 or superior, it´s useless.
I have this code below:
set_include_path(get_include_path() . PATH_SEPARATOR . './phpseclib0.3.0');
if(!include('Net/SSH2.php')){
echo "ssh2 not included<br>";
}else{}
if(!include('Net/SFTP.php')){
echo "sftp not included";
}else{}
$strServer = 'mi hoting';
$intPort = 22;
$strUsername = 'my user';
$strPassword = 'my pass';
$objFtp = new Net_SFTP($strServer, $intPort);
if (!$objFtp ->login($strUsername, $strPassword)) {
exit( 'Login Failed' );
}
$objFtp->disconnect();
Someone knows or see my mistake The phpseclib0.3.0 folder it´s in the same directory as the ftp connection file