0

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

Cosmin
  • 125
  • 11

1 Answers1

1

for the -k

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

check it out : php curl -k or --insecure, -X

Community
  • 1
  • 1
wlalele
  • 333
  • 5
  • 16