It's quite simple actually..
dig AAAA ftp.openldap.org
ftp.openldap.org. 3600 IN CNAME www.openldap.org.
www.openldap.org. 3600 IN AAAA
2001:4f8:3:ba:2e0:18ff:fe02:efec
$ php -r
"var_dump(gethostbyname(gethostbyaddr('2001:4f8:3:ba:2e0:18ff:fe02:efec')));"
string(14) "204.152.186.50"
$ php -r "var_dump(gethostbyname('ftp.openldap.org'));"
string(14) "204.152.186.57"
gethostbyname() internally uses the same C function, while ftp_connect() uses php_network_getaddresses().
my system and php tries to use ipv6, which is not strange these days, and
therefor tried to connect to 204.152.186.50, which will return false for the
ftp_connect() call.
But ftp_open() *does* support IPv6 (at least in CVS). A PHP bug?
Nuno