function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KunlunKunlun 

Error of "Could not connect to host" for php api connection

Hi All,

 

We made a php api program to upload case to SFDC on our server. Mainly it works fine, but sometime the uploading program doesn't work and threw error message as "Could not connect to host".

 

I checked the error code, it occurred on api login salesforce ($loginResult = $sforce->login(xxxx, yyyy);). So it seems that our programe can not login SFDC with php api at that time. It works most of time, but error occurred about 5-10 times every day.

 

 

So there might be some issues:

1. Server can not connect SFDC at that time. 

2. SFDC reject the connection from our server.

3. Time out for connection


For 1#, we can access SFDC manually.

For 3#, The default socket timeout of php configration is 60 second. I think it should be OK.

 

For 2#, I researched something from internet, some one solve this issue with below action:

----------------------------------------

turned out that the firewall of the ticketing system we were connecting to had a setting that limited the maximum number of connections from a single I.P. address. Since all the API requests were coming from one IP (the webserver) we were hitting this limit which triggered the error.

To fix it an exception was added for our IP and we haven't seen it since.
----------------------------------------

What should I do in salesforce to do above setting?

 

 

Any one met this issue before? Who can help me, thanks

 

Kunlun

 

 

 

 

 

linkuplinkup

We started having the exact same issue in the last 2 days as well. I'll update as/if I find any work-arounds.

KunlunKunlun

Thanks very much.