oops, forgot to mention something..
the ipv6 address, which is being used by default, is attached to a server that
gives a Connection Refused error
that is why the ftp function won't work. it uses ipv6 fine, but the server
refuses.
the ipv4 ip that is returned by the gethostbyname() in the script will also
return the correct and most used ip, which is good
some time ago there was a problem with nl3.php.net, which ended up with an
incorrect setup for ipv6, the ipv4 site worked fine
I've contacted the openldap.org team, I hope they can fix this issue because
it should not be needed, but I noticed that after some more research.
So, the problem shouldn't be fixed in the script. Anyway, the "oficial" server doesn't have php compiled with IPv6...
Nuno