Title: Avoid curl_exec() PHP Function
Last modified: May 30, 2023

---

# Avoid curl_exec() PHP Function

 *  Resolved [Benjamin Stocker](https://wordpress.org/support/users/bstocker/)
 * (@bstocker)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/avoid-curl_exec-php-function/)
 * Hello!
 * A new Version of Wordfence uses the curl_exec() PHP Function in the wfWAFHTTP
   Class. But curl_exec() is disabled by my (and by other) Hosting provider. Because
   curl_exec() is often used by Malware.
 * And there is only a single occurence of curl_exec(). Is there a way to avoid 
   this Function or replace it with – say – file_get_contents()?
 * Many thanks, Benjamin

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * (@wfpeter)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/avoid-curl_exec-php-function/#post-16784001)
 * Hi [@bstocker](https://wordpress.org/support/users/bstocker/), thanks for getting
   in touch.
 * Wordfence does fall back to `file_get_contents()` if it detects that cURL isn’t
   installed, though we can’t confirm whether it works on all hosts. We do test 
   a large number of environments as you’d expect, but can’t cover them all.
 * The plugin detects cURL by checking whether the `curl_init()` function exists.
   If you or your host is disabling cURL, it would be best to either remove the 
   cURL extension entirely, or disable `curl_init()` as well.
 * Thanks,
   Peter.
 *  Thread Starter [Benjamin Stocker](https://wordpress.org/support/users/bstocker/)
 * (@bstocker)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/avoid-curl_exec-php-function/#post-16785092)
 * Hello Peter
 * Many thanks for your quick reply. 
   Disabling `curl_init()` really did the trick!
 * With best wishes and greetings
 * Benjamin
 *  Plugin Support [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * (@wfpeter)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/avoid-curl_exec-php-function/#post-16797257)
 * Great news [@bstocker](https://wordpress.org/support/users/bstocker/)!
 * If you have further Wordfence questions in the future, by all means start a new
   topic and we’ll be glad to help out any time.
 * Peter.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Avoid curl_exec() PHP Function’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/avoid-curl_exec-php-function/#post-16797257)
 * Status: resolved