I'm not sure if this is me doing something wrong or whether the server just doesn't support phpseclib or what, but I am trying to connect to an FTP server that will only accept secure FTP connections, and only from certain IP addresses. Now I know that the FTP server accepts a connection from my VPS server as I have remotely connected into my VPS via SSH and manually connected to the FTP server from the command line successfully.
However when I try the following with phpseclib it always hits the exit point.
set_include_path(get_include_path() . PATH_SEPARATOR . 'phpseclib');
include 'Net/SFTP.php';
$sftp = new NET_SFTP('***');
if(!$sftp->login('***', '***')) {
$sftp->getSFTPErrors();
exit('Login Failed'); // <-- Code always gets to this point
}
echo $sftp->pwd();
I am unsure on how to even begin debugging this problem. I have asked a question on their forum as well to try and get help. I have tried to enable logging with define('NET_SFTP_LOGGING', NET_SFTP_LOG_COMPLEX);
and then output echo $sftp->getSFTPLog();
just above the exit, but that doesn't output anything.
On the page I have just Login Failed
, so I'm not getting any errors from $sftp->getSFTPErrors();
.
I am completely new to using a secure FTP connection in PHP and don't know what I am doing wrong. Can someone please help me debug the issue?
The way you're using it it's clear that you don't see any errors.
$sftp->getLastSFTPError()
returns a string and $sftp->getSFTPErrors()
returns an array, and that's what you have to echo in order to see what's wrong.
Try
print_r($sftp->getSFTPErrors());
I understood that GEOHASH allows to hash (lat,long) into a String
I have created update button on my every row in table dynamically using JQuery that successfully editing the table but i don't know how to call php function for updating the database,
I have an Inline editable Table which updates the Mysql table for the team group column I want to use the drop-down list