Reputation: 125
I'm having a cli curl command to purge an image from varnish.
curl -v -k -X PURGE https://www.example.com/assets/image.jpg
How can i convert this to php curl?
I've got so far
$varnish_curl = curl_init($varnish_url);
curl_setopt($varnish_curl, CURLOPT_VERBOSE, TRUE); // -v
curl_setopt($varnish_curl, CURLOPT_CUSTOMREQUEST, "PUT"); // -X
curl_setopt($varnish_curl, CURLOPT_CUSTOMREQUEST, "PURGE");
curl_exec($varnish_curl);
curl_close($varnish_curl);
Can't seem to find any option for -k
Upvotes: 0
Views: 77
Reputation: 333
for the -k
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
check it out : php curl -k or --insecure, -X
Upvotes: 1