recurly / recurly-client-php

Recurly PHP Client
http://recurly.com
MIT License
172 stars 93 forks source link

Failed to connect to Recurly (Could not resolve host: .recurly.com) #302

Closed joneslloyd closed 7 years ago

joneslloyd commented 7 years ago

Hi there,

I'm just trying to make a request (get an account), but I get the following error:

Feb 10 14:05:23 192.168.205.226 apache2[26701]: [u697] [mysite.com] [188.142.246.7] [Fri Feb 10 14:05:23 2017] [error] [pid 26701] mod_proxy_fcgi.c(673): [client 192.168.201.211:49716] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Recurly_ConnectionError: Failed to connect to Recurly (Could not resolve host: .recurly.com). in /gfrecurly-www/wp-content/plugins/gravityforms-recurly/includes/recurly-api/lib/recurly/client.php:204
Stack trace:
#0 /gfrecurly-www/wp-content/plugins/gravityforms-recurly/includes/recurly-api/lib/recurly/client.php(165): Recurly_Client->_raiseCurlError(6, 'Could not resol...')
#1 /gfrecurly-www/wp-content/plugins/gravityforms-recurly/includes/recurly-api/lib/recurly/client.php(89): Recurly_Client->_sendRequest('GET', 'https://.recurl...', NULL)
#2 /gfrecurly-www/wp-content/plugins/gravityforms-recurly/includes/recurly-api/lib/recurly/base.php(27): Recurly_Client->request('GET', '/accounts/AvZVI...')
#3 /gfrecurly-www/wp-content/plugins/gravityforms-recurly/includes/recurly-api/lib/recurly/account.php(48): Recurly_Base::_get('/accounts/AvZVI...', Object(Recurly_Client))
#4 /gfrecurly-www/wp-content/plugins/gravityforms-recurly/classes/class-gf-recurly-api-wrapper.php(1...
'

Do you know why it could be happening? And why the host is .recurly.com rather than the full hostname?

bhelx commented 7 years ago

Hey @joneslloyd,

Check that you have set your subdomain:

Recurly_Client::$subdomain = 'your-subdomain';
joneslloyd commented 7 years ago

You were completely right. It was being set, but lost because of some PHP / namespace issue :)

bhelx commented 7 years ago

@joneslloyd No problem. It's actually really helpful to have this here for other people who may be searching against that error message. Thanks for updating us!