You could do a pre check with fsockopen() and store its connection state in session (so as to not do the check on every reload).
<?php
session_start();
if(!isset($_SESSION['ftp_connectable'])){
$sock = @fsockopen('ftp.yourserver', 21, $errno, $errstr, 1);//< 1sec timeout
if ($sock) {
$_SESSION['ftp_connectable'] = true;
}else{
$_SESSION['ftp_connectable'] = false;
}
@fclose($sock);
}
if($_SESSION['ftp_connectable'] === true){
echo '<span style="color:red">FTP Server is connectable!</span>';
}else{
echo '<span style="color:red">FTP Server is not connectable!</span>';
}
Then show a notice the server is down based on $_SESSION['ftp_connectable']
you can add a Try Again button that clears the $_SESSION['ftp_connectable']
variable and try's the connection state again.