• Resolved meatberg

    (@meatberg)


    hi – i use the following code on https://www.naturopathy-uk.com/events/events-opendays-uk/

    to include categories/posts from WordPress (WP installed on same server in naturopathy-uk.com/blog – used for 7 sites hosted on same server(commented out herefor safety reasons):

    <?php
    //$ch = curl_init();
    //curl_setopt($ch, CURLOPT_URL, “https://www.naturopathy-//uk.com/blog/?cat=22&#8221;);
    //curl_setopt($ch, CURLOPT_HEADER, 0);
    //curl_exec($ch);
    //curl_close($ch);
    ?>

    My host said fine, now they say it’s a security issue and want me to remove it. I think it’s a PHP issue fixed here on https://www.php.net/

    PHP 4.4.4 and PHP 5.1.5 Released
    [17-Aug-2006] The PHP development team would like to announce the immediate availability of PHP 5.1.5 and 4.4.4. These two releases address a series of security problems that were discovered since the release of PHP 5.1.4 and 4.4.3. The new releases include the following changes:

    Fixed possible open_basedir/safe_mode bypass in cURL
    extension and on PHP 5.1.5 with realpath cache.

    I’m stuck. Can’t use fOPEN. Any ideas for alternatives?

    Best,

    -Rob

Viewing 9 replies - 1 through 9 (of 9 total)
  • no curl, no fopen? nope.

    You should ask your hoster why he won’t upgrade to the new version of PHP. Since the problem is fixed your hoster should have no problem with the use of the cURL library. But if he insists to have that code removed you should consider to change to a more professional hoster.

    Thread Starter meatberg

    (@meatberg)

    please don’t tell me iframes. not IFRAMES.

    here’s the host’s note:

    Hi Rob

    I am really sorry about this but you need to change the pages on your site which use c-u-r-l immediately.

    We have been subjected to repeated hacker attacks & engineers have instructed me that they need to turn off c-u-r-l immediately.

    You need to make any changes now. If we do not disable c-u-r-l then there is a very high chance that the whole server will be taken offline.

    Please get back to me asap.

    Thread Starter meatberg

    (@meatberg)

    they’re running 4.4.4

    HTTP/1.1 200 OK Date: Tue, 12 Sep 2006 12:08:20 GMT Server: Apache/2.0.46 (Red Hat) X-Powered-By: PHP/4.4.4 X-Pingback: https://www.naturopathy-uk.com/blog/xmlrpc.php Status: 200 OK Content-Length: 275 Content-Type: text/html; charset=UTF-8

    They’ve been fine in the past, but this time I think it’s their problem, not mine. Maybe it is time to move.

    Did you try snoopy? It just came to my mind, that I’m using it with great success. (wp-includes/class-snoopy.php)

    grep’ing through the file, it seems that it uses curl too, but the binary and not the library (which seems to be the problem).

    Thread Starter meatberg

    (@meatberg)

    hmm. looking at https://sourceforge.net/projects/snoopy/ now, and the wp-includes/class-snoopy.php file. not sure how i’d implement this, as i’m a novice, but worth looking into. i’ll give it a try.

    all i do is include the url of the post or category i want to appear in the .php file (using first fopen, then curl when fopen was nixed by the host). do you have an example of how you might do this using snoopy?

    Include the snoopy class and do this:


    $snoopy = new snoopy;
    $snoopy->fetch("https://www.naturopathy-uk.com/blog/xmlrpc.php");
    echo $snoopy->results;

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Snoopy should work without the fopen_wrappers, because it uses fsockopen to connect directly, and then fwrite/fread to send the HTTP request manually and get the data.

    However, Snoopy will not work with HTTPS connections, because it uses CURL for those.

    Thread Starter meatberg

    (@meatberg)

    leflo,

    that works like a charm – very useful indeed. we downloaded the class and it took a moment to work it out. have run it by my host (they’ve decided to let CURL stand for the moment) to see if they can work with this. but the utility with snoopy is great for what we’re doing, as far as re-purposing our content. many thanks : )

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘need alternative to C-U-R-L for including posts’ is closed to new replies.