View Full Version : PHP - how to get headers of an HTTPS page?

07-09-2012, 02:25 PM

i'd like to check the server headers (200/404/502) of an HTTPS page.

how do i do that in PHP?

the function get-headers doesn't support HTTPS.

thanks guys!

07-09-2012, 04:01 PM
Use CURL instead, or sockets are always an option.
In CURL, you'll need to disable the peer verification for the SSL unless you go abouts providing it with some more SSL information.
There's actually an example on the curl_setopt page: http://ca.php.net/manual/en/function.curl-setopt.php
Just search for "HTTPS" until you get to user examples. A few in there's one that shows what headers to send for https requests for a head.