I have hit a problem with establishing an ftp connection.
About 1 hour ago I modified and ran a script.
Originally the script ftp connected from my server to a FastHost server, copied some files across and the closed the connection. About an hour ago it was all working fine.
I then modified the script, I told the script to delete a file, then copy another then close the connection. However the script tried to delete a file via ftp that wasn’t there which threw an error.
Noticing my scripting error I rolled back my script with svn to a few hours ago when I knew the script was working…
However now my server cannot connect to via ftp a FastHost server.
NB I know the connection details are correct as I can connect with filezila with them
Have I locked my self out? Has anyone had his before?
Here is where the code is failing:
if($connection)
{
ftp_close($connection);
}
$connection = @ftp_connect($host);
$login = @ftp_login($connection, $uname, $pword);
if(!$connection)
{
return "Connection Failure <br/>$host<br/>$uname<br/>$pword<br/>$docroot";
}
elseif(!$login)
{
return "Login Failure <br/>$host<br/>$uname<br/>$pword<br/>$docroot";
}
else{
// enabling passive mode
ftp_pasv( $connection, true );
It keeps failing on $connection. I was hoping there might have been a time lock invoked and would have cleared this morning but no joy.
It turns out that if you try to delete a file via ftp on a file that doesn’t exist FastHost servers basically add your server to a black list.
As a result of being on this black list you will simply not be able to connect via ftp untill the lock has been removed.
After contacting the fasthost team this morning they confirmed this and removed the lock and now all is functioning again.