How to properly use curl_init for a GET request in PHP? or What's the correct way to handle a curl_in

18 Replies, 1478 Views

If you’re on Windows, sometimes curl_init get requests fail because of CA certs. Download cacert.pem from curl’s site and add this:

```php
curl_setopt($ch, CURLOPT_CAINFO, 'path/to/cacert.pem');
```

Also, enable verbose mode for more details:

```php
curl_setopt($ch, CURLOPT_VERBOSE, true);
```

Messages In This Thread



Users browsing this thread: 1 Guest(s)