Curl Function of php isn't working !!!

Mrinmoy

Active Member
Feb 2, 2019
38
5
8
India
cPanel Access Level
Website Owner
Curl function of php 7.4 isn't working properly. I use a custom code to check as per my requirements & it is showing me that the function isn't working properly. Now when I contacted my hosting provider they told me to check my phpinfo, which is showing that the curl function is 'enabled' btw. According to them there is nothing they can do at their end.

Any kind of help or suggestion is much appreciated..!! Thanks..
 

andrew.n

Well-Known Member
Jun 9, 2020
983
363
63
EU
cPanel Access Level
Root Administrator
Would you mind showing us some examples? how you mean it doesn't work properly? PHP 7.4 is a new version so maybe your script is not compatible....have you tried with lower versions?
 

andrew.n

Well-Known Member
Jun 9, 2020
983
363
63
EU
cPanel Access Level
Root Administrator
Do you get any error when you run the code? We are not developers unfortunately so if this is related to a code issue I'm not sure if we can help you with it though other fellow forum members might have further input here but the best would be to let us know the error you are getting so we can advise.
 

Mrinmoy

Active Member
Feb 2, 2019
38
5
8
India
cPanel Access Level
Website Owner
Ok, the code is developed by an open source developer.. It's function is to identify whether or not the curl function is working... Here are the results...

Checking for the existence of the curl_init() function...PASS

Checking for the successful functioning of single-page, HTTP (non-HTTPS) curl downloads...FAIL

The curl_exec() function returned false.
The curl_error() function reports: Connection timed out after 10001 milliseconds

Checking for the successful functioning of single-page, HTTPS curl downloads...FAIL

The curl_exec() function returned false.
The curl_error() function reports: Connection timed out after 10001 milliseconds

Checking for the successful functioning of multi-page, HTTP (non-HTTPS) curl downloads...FAIL

The curl_multi_getcontent() function returned an empty string or equivalent (but not false) (for URL <Example Domain>).
The curl_error() function reports:

Checking for the successful functioning of multi-page, HTTPS curl downloads...FAIL

The curl_multi_getcontent() function returned an empty string or equivalent (but not false) (for URL <Example Domain>).
The curl_error() function reports:

At least one of the tests failed. Link Tools functionality will be limited because the Client URL Library (curl) does not appear to be functioning correctly. For more details on this library, please see here: <PHP: cURL - Manual>.
 

andrew.n

Well-Known Member
Jun 9, 2020
983
363
63
EU
cPanel Access Level
Root Administrator
Looks like firewall is blocking curl and that's why it doesn't work so you should ask your hosting provider to investigate it.
 

Mrinmoy

Active Member
Feb 2, 2019
38
5
8
India
cPanel Access Level
Website Owner
My developer also told me that once...That it can be blocked by a firewall or something such sort..

But my hosting service is denying anything as I already said here earlier... If I can state specifically by saying " that firewall " is blocking then it might get the job done..
 

andrew.n

Well-Known Member
Jun 9, 2020
983
363
63
EU
cPanel Access Level
Root Administrator
Where does this curl script is trying to connect and on what port? Can you look into the script and see? If you got the address and the port first you can see if you can lookup on the domain:

nslookup domain.com

if that works then you can try wget and see if that times out then you can tell the provider you can't access this domain on that port as you are getting timed out error.
 
  • Like
Reactions: cPRex and Mrinmoy

Mrinmoy

Active Member
Feb 2, 2019
38
5
8
India
cPanel Access Level
Website Owner
It turns out that our hosting is blocking outbound links. And they have blocked facebook too. As, I have installed a FB extension on some pages. For our users. And it is not working for a week.

But as I have contacted support. Still they have no clue. They only keep saying that on their part there is nothing to be done..:(