I'm trying to use ftp_connect('ftp.is.co.za') [for example] in PHP 5 or higher (multiple different versions on different machines). I can use the ftp command from the shell in all cases successfully, so it's no a firewall or connectivity issue. I always get NULL as a result, and no errors, if the domain name is valid and serving FTP. I do get errors when there is a problem, i.e. I'm getting NULL as a success message. All versions of PHP involved are compiled with --enable-ftp.
Thanks
As requested, an example:
$ ftp ftp.is.co.za
Connected to ftp.is.co.za (196.4.160.12).
220 ProFTPD 1.3.1 Server (Welcome to Internet Solutions FTP service.) [196.4.160.12]
Name (ftp.is.co.za:myusername):
Login failed.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> 221 Goodbye.
$ php -a
Interactive shell
php > var_export(ftp_connect("ftp.is.co.za"));
NULL
php >
$