1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    May 2004
    Boston, MA USA
    Rep Power

    cURL in WordPress ?

    I'm not sure this is the best forum but I wasn't sure what was better and I like the PHP community.

    I have a small SaaS business management tool developed in PHP/MySQL. My customers (business managers) can export data from my system to their own websites using a cURL function similar to:
    $ch = curl_init();
    curl_setopt ($ch, CURLOPT_URL, "$URL");
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
    $contents = curl_exec($ch);
    echo $contents;
    One of my customer's web site is developed in WordPress which I have no experience with. They are not having any luck implementing the cURL function.

    Can anyone give me any advice or point me to a good resource to help?

  2. #2
  3. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Washington, USA
    Rep Power
    Well first you have to understand why it's not working. Having WordPress or not shouldn't make a difference - could it be that they don't have cURL installed?

    Basic troubleshooting steps, here. How does it not work? Are there any error messages? Checked the server error logs?
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2017
    Rep Power
    I didn't check WP code, but I'm 99.99% sure it would contain one or more curl-based functions itself. I mean, WP doesn't prevent curl from working on the same site where WP is installed.

    We can surely give you a solution (especially when the code is such simple), but we need to know more details. Please let us know what errors you get, what debugging was made, etc. Especially, please indicate how clients run this script. I mean, did they just upload some PHP file with curl code on the same site where WP is installed, or did they make a plugin for WP, so they execute the code inside WP admin dashboard?

IMN logo majestic logo threadwatch logo seochat tools logo