ftp_connect stopped working through target hostname
Server OS: Cloudlinux8
Strange issue.. for the longest time I was able to FTP from one virtual hosting account to another (in the same server) using `ftp_connect("TARGET_HOSTNAME",21,30)`, however after some recent server updates this script no longer connects to the target account through the domain name. I tried the IP address of the domain and this did not work either. I can however FTP login from any computer using any ftp client like filezilla etc.. without any issues. I also tried turning off and on the CSF firewall to see if there was some kind of firewall blocking this but this did not change anything. I eventually was able to solve this issue by changing the IP address to 127.0.0.1, ftp_connect("127.0.0.1",21,30) so my application issue is solved. However my question is, what can cause this type of issue where one account can no longer FTP to another account view hostname? How should I be trouble shooting this to figure out what the problem is?
-
Hey there! Did you get a specific error when you used the hostname vs the IP address? This seems more like a DNS error or hostname lookup issue than a problem with PHP or cPanel, but it's hard to tell from that information.
Are you using resolvers provided by your host in /etc/resolv.conf or public resolvers?
0
Please sign in to leave a comment.
Comments
1 comment