cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution

Cannot connect to external server using fsockopen

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)

3 REPLIES 3
Community Manager
Community Manager
Solution

Re: Cannot connect to external server using fsockopen

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. 

 

JesseW - GoDaddy | Community Manager | 24/7 support available at x.co/247support | Remember to choose a solution and give kudos.

Re: Cannot connect to external server using fsockopen

Please can you guys open the closed ports?

Highlighted
Community Manager
Community Manager

Re: Cannot connect to external server using fsockopen

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. 

 

JesseW - GoDaddy | Community Manager | 24/7 support available at x.co/247support | Remember to choose a solution and give kudos.