Problem with recieving data with cURL


I’m studying Airtable API and I have problem with receiving anything with cURL in PHP. All I’m getting is NULL value. Here is my code:

			function refreshCache(){
				//get cURL resource
				$ch = curl_init();
				//set url
				curl_setopt($ch, CURLOPT_URL, '');
				$out = curl_exec($ch);
				file_put_contents('cache.txt', $out);

I know that I should receive SOMETHING, because table and rows aren’t empty. What I’m doing wornd? Thank you!

OK I get what’s wrong. I’ve tested it on local server with XAMPP and, when I used curl_error($ch), I get error like

error setting certificate verify locations: CAfile: C:\xampp\apache\bin\curl-ca-bundle.crt CApath: none

Then I knew, that I should use host server, because xampp had certificate problems and I didn;t had time to solve it. How I recieved some real data with json format. And from now I think I can manage it :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.