(there are a lot of similar question on StackOverflow, but the qulity of answers is not very good for all the ones I've looked at - hence not marking this as a duplicate)
I can't tell you why it has been disabled on the installation you are using, but it is common practice on basic hosting packages to restrict the level of functionality and the applications ability to interact with the local infrastructure. I would like to think that conscientious package maintainers would also distribute PHP with as safe a default configuration as possible.
I'm totally lost and starting from scratch on these API/curl calls...
There's 2 issues here - your understanding of how this should work and the error message that is preventing your code from running. If we worry about the latter then at least you will be in a position to address the former yourself.
WARNING curl_init() has been disabled for security reasons
This message indicates that either safe_mode is enabled or curl_init is included in the list of disabled functions in your PHP.ini.
If you don't know where your php.ini file is - check the output of
<?php phpinfo();
Note that some ini settings can be overridden elsewhere - e.g. in Apache's httpd.config or .htaccess files - but not these ones.
If you cannot access the ini file, or the setting are you can check these using:
<?php
print ini_get('disable_functions')
. "<br>" . ini_get('disable_classes')
. "<br>" . init_get('safe_mode');
In the case of curl_init, we are really only interested in the first one of these. But as per above - if we are talking about host you don't have full control over, then it may be a constraint of your hosting package.
IIRC, an entry in disable_functions will mask out a missing extension - so you might remove the entry from php.ini and start seeing undefined function errors. In that case you need to install the extension as described by others here (but the relevant filename is php_curl.so on Unix/Linux systems) remembering to restart httpd/php-fpm as appropriate.
You can now call the function. That doesn't mean that your host will be able to:
- resolve the hostname in the URL
- establish an http/https connection
But you'll see different errors.