Last active
August 29, 2015 14:04
-
-
Save svdmitrij/235c7fb0965213aa1d4b to your computer and use it in GitHub Desktop.
Test curl connection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$_h = curl_init(); | |
curl_setopt($_h, CURLOPT_HEADER, 1); | |
curl_setopt($_h, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($_h, CURLOPT_HTTPGET, 1); | |
curl_setopt($_h, CURLOPT_FOLLOWLOCATION, true); | |
curl_setopt($_h, CURLOPT_URL, 'TESTING_URL' ); // Change TESTING_URL on url that you want to test. | |
curl_setopt($_h, CURLOPT_DNS_USE_GLOBAL_CACHE, false ); | |
curl_setopt($_h, CURLOPT_DNS_CACHE_TIMEOUT, 2 ); | |
var_dump(curl_exec($_h)); | |
var_dump(curl_getinfo($_h)); | |
var_dump(curl_error($_h)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment