I'm unable to use PHP's fsockopen function to connect to an external server. The error is:
PHP Warning: fsockopen(): unable to connect to XXX.XX.XXX.XXX:9105 (Connection refused) in /home/path/to/file.php on line XX
I've tried changing all of my iptables rules on the external server. After some debugging, I can safely say that the connection isn't even getting from my GoDaddy website to my external server. The problem is definitely on the GoDaddy end of the request.
Does GoDaddy block ports by default with fsockopen? If so, is it possible to get a select few (or even just one) opened? If not, are there any alternatives?
(Adding HTML as a dummy label because this thing won't let me submit without another one)
Solved! Go to Solution.
Hey @bls1999. Thanks for being part of GoDaddy Community! I reviewed this with someone in our hosting department. We tested to see if fsockopen could be used on cPanel and found it could. However, you may want to try connecting via port 80 if that's possible. Many ports are closed on Shared Hosting plans. Hope that helps.
Hi @RogimRadio. That's not a service that's available with our Shared Hosting accounts. However, if you have a VPS or Dedicated Server, you would have greater control over what ports are available.