a truck loading another truck

Check if curl is loaded as module in php

Here are a couple of things to check if cURL is loaded as module or not

1. You can check by using phpinfo();
Just create a single php file and name it as phpinfo.php file and in it add

phpinfo();

Then call the page on your browser and when it loads do the control plus F and search for curl module there. If you can find it, then it means it is loaded.

2. Create a page and name it as test_curl.php and inside that file, add the following code.

if ( in_array('curl', get_loaded_extensions()) ){
echo "Curl is loaded";
} else {
echo "No, I can't find curl";
}

Either of the above two methods would tell you if you have curl to be used as extension or not

setting XDEBUG variable through cookies

We know how important xdebug in php is .. no post on that :)
when it is through the url, we will use the

XDEBUG_SESSION_START=somevariable

But, when you are using curl or some other client for using a post, cookie is a rescue

CURL_COOKIE = 'XDEBUG_SESSION=somevariable'

Just add the above as one of the curl options and you should be good.

Listing all the curl constants and viewing them in PHP – how to see the curl opt integer constants

Here is the thing :), I was working on some API where there is an example of cURL usage for it. For some weird reason the developer has decided to use the php cur option integer constant rather than the nice constant names [listed here].
So i have to use this little snippet to reverse match them..
No biggie, just sharing

$all_constants=get_defined_constants(true); // list all defined constants in the world
$curl_opts=array_flip($all_constants['curl]);
ksort($curl_opts);
print_r($curl_opts);