API Connection Refused

For discussion of the Poker Mavens server module and other administration topics
Post Reply
DeuceRag
Posts: 3
Joined: Sat Aug 25, 2012 12:05 pm

API Connection Refused

Post by DeuceRag »

Hello, we just bought PM Pro yesterday and have written Drupal modules to tie it into our existing site.

I'm using the example PHP files provided on this site and I am working with the SystemStats.php at the moment just to get the API working correctly.

Right now I get a perfect response if I cheat and type the URL and parameters into the address bar of a browser, but when using libcurl in code it fails with "Connection Refused" .. I have verfied libcurl seems to be working correctly otherwise and I'm at a loss as to where to look.

I have not modified any of the example code other than to input my own URL and API password.

Any suggestions would be awesome. Thank you!
Kent Briggs
Site Admin
Posts: 5878
Joined: Wed Mar 19, 2008 8:47 pm

Re: API Connection Refused

Post by Kent Briggs »

DeuceRag wrote:Right now I get a perfect response if I cheat and type the URL and parameters into the address bar of a browser, but when using libcurl in code it fails with "Connection Refused" .. I have verfied libcurl seems to be working correctly otherwise and I'm at a loss as to where to look.
Is the PHP running on a different system than the poker server? If so, check with your PHP host provider and see if they have firewall settings blocking any destination ports (like 8087). A lot them will allow outgoing connections to port 80 and block everything else by default.
DeuceRag
Posts: 3
Joined: Sat Aug 25, 2012 12:05 pm

Re: API Connection Refused

Post by DeuceRag »

Sorry, after hours of beating my head against the wall. I SSH'd into my shared hosting account and tried a wget with the URL I could get to work from the browser. This failed too. Got on live chat with HostGator and sure enough, they were blocking outbound ports, but corrected it for me.

Maybe this will save someone else some time.

Thanks!
DeuceRag
Posts: 3
Joined: Sat Aug 25, 2012 12:05 pm

Re: API Connection Refused

Post by DeuceRag »

Kent Briggs wrote:
DeuceRag wrote:Right now I get a perfect response if I cheat and type the URL and parameters into the address bar of a browser, but when using libcurl in code it fails with "Connection Refused" .. I have verfied libcurl seems to be working correctly otherwise and I'm at a loss as to where to look.
Is the PHP running on a different system than the poker server? If so, check with your PHP host provider and see if they have firewall settings blocking any destination ports (like 8087). A lot them will allow connections to port 80 and block everything else by default.
Yes, this is what happened. Thank you!
Post Reply