I know this may seem like a dumb question, but is there a way to get more information about WHY ftp_connect or ftp_login failed? I have this code which works on 2/3 servers I can upload it to (as well as both of my local installs: WAMP, and LAMP) however I can't seem to find anywhere that tells me how to get more information about why its failing on the one. Using phpinfo() I see that FTP is enabled on all servers.
<?php
include('ftp_config.php');
if( $ftp = ftp_connect(FTPHOST) ) {
if( ftp_login($ftp,FTPUSER,FTPPASS) ) {
ftp_pasv($ftp,TRUE); // Added based on searching
if( ftp_put($ftp,'index.php','index.php') ) {
echo 'File upload successful';
} else {
echo 'File upload failed';
} else {
echo 'Login failed';
}
ftp_close($ftp);
} else {
echo 'Connection failed';
}
However as would be expected the only information I get on the server that's failing is 'Connection failed'. Looking at the manual for ftp_connect and ftp_login I see no way to get more information about WHY its failing, especially considering the same code and login credentials are working on another server.
Thanks in advance.