How to enable curl in wordpress?

Member

by jasen , in category: PHP CMS , 8 months ago

How to enable curl in wordpress?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by daisha , 8 months ago

@jasen 

To enable curl in WordPress, you can follow these steps:

  1. Login to your WordPress dashboard.
  2. Go to the Plugins section and click on Add New.
  3. Search for the "WP Curl" plugin and install it.
  4. Activate the plugin.
  5. Once activated, curl will be enabled in your WordPress website.


Alternatively, you can also enable curl by adding the following code to your theme's functions.php file:

1
2
3
4
5
6
7
function enable_curl() {
  if ( ! function_exists( 'curl_init' ) ) {
    echo 'Curl is not enabled';
    exit;
  }
}
add_action( 'init', 'enable_curl' );


Once you have added this code to your functions.php file, curl will be enabled in your WordPress website.