Calling curl gurus
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

[Closed] Calling curl gurus

3 Posts
4 Users
0 Reactions
106 Views
Posts: 386
Full Member
Topic starter
 

I have a website in which I have used the following curl commands to load the contents of a file into a web page:

$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, WB_URL.'/pages/blocks/meeting.php');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);

This is no longer working. I am thinking there has been a change in syntax. Can anyone advise how I can correct this, please.


 
Posted : 27/01/2022 5:00 pm
Posts: 13594
Free Member
 

I only use Curl occasionally, I'd check which version you have installed. Lastest update was 5 Jan.

Changelog here: https://curl.se/changes.html#7_81_0

Can't see anything obvious.

Have you checked the source data is still in the same place with the same permissions etc?


 
Posted : 27/01/2022 5:28 pm
Posts: 5297
Full Member
 

If there's an issue with the code it should be spitting out an error somewhere.

Although I'd agree with the above. It's more likely to be something outside of the code. It may still be spitting out an error somewhere.


 
Posted : 27/01/2022 5:31 pm
 Aidy
Posts: 2941
Free Member
 

That's kinda php, rather than curl.

And wow, what a horror show that is.

(I doubt curl or the php library has changed enough for either of them to be the issue. Perhaps whereever you have it hosted has changed it so that php can no longer call out to external binaries, or restricted access to the relevant website. Assuming the relevant website hasn't just gone away.)


 
Posted : 27/01/2022 5:52 pm

6 DAYS LEFT
We are currently at 95% of our target!