Can't get your sample PHP to work

Posted about 6 years ago by webmastah

Post a topic
Answered
w
webmastah

Hi there.


I just signed up for Crawlera because I saw just how simple your PHP sample script (https://support.scrapinghub.com/support/solutions/articles/22000203568-using-crawlera-with-php) was. However, I cannot get it to work. I keep getting this error message all the time:


cURL error: Failed connect to proxy.crawlera.com:8010; Connection refused


I have waited for provisioning to happen, copied my api key in the script and uploaded the crt file to the server and updated the path variable (CURLOPT_CAINFO) accordingly.


Still, the same error over and over again. In fact, I don't really know what's the correct way to replace the API KEY variable in the script:


$proxy_auth = '<API KEY>:';


I have tried all possible ways I can imagine:


$proxy_auth = 'myapikey';

$proxy_auth = 'myapikey:';

$proxy_auth = '<myapikey>:';

$proxy_auth = '<API KEY>:myapikey:';


I think this should be made clear somewhere. I can't seem to find any information about this.


Could anyone help me, please. Thanks in avance.


Cheers,

David

0 Votes

nestor

nestor posted about 6 years ago Admin Best Answer

Check your firewall rules, port 8010 needs to be open as it is the port Crawlera serves.

1 Votes


5 Comments

Sorted by
p

promoautotest posted about 4 years ago

I'm still facing problem after port open, can someone please help me for below error - 


cURL error: Failed to connect to proxy.crawlera.com port 8010: Connection refused

0 Votes

nestor

nestor posted about 6 years ago Admin

I'm glad you got it working :)

0 Votes

w

webmastah posted about 6 years ago

By the way, Nestor. You were right. The problem was the firewall. As soon as I opened the port, it worked right away. Thank you!

0 Votes

w

webmastah posted about 6 years ago

Thanks for your input, Nestor. I will give it a try!

0 Votes

nestor

nestor posted about 6 years ago Admin Answer

Check your firewall rules, port 8010 needs to be open as it is the port Crawlera serves.

1 Votes

Login to post a comment