[resolved] need alternative to C-U-R-L for including posts (10 posts)

  1. meatberg
    Posted 9 years ago #

    hi - i use the following code on http://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):

    //$ch = curl_init();
    //curl_setopt($ch, CURLOPT_URL, "http://www.naturopathy-//uk.com/blog/?cat=22");
    //curl_setopt($ch, CURLOPT_HEADER, 0);

    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 http://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?



  2. whooami
    Posted 9 years ago #

    no curl, no fopen? nope.

  3. leflo
    Posted 9 years ago #

    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.

  4. meatberg
    Posted 9 years ago #

    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.

  5. meatberg
    Posted 9 years ago #

    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: http://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.

  6. leflo
    Posted 9 years ago #

    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).

  7. meatberg
    Posted 9 years ago #

    hmm. looking at http://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?

  8. leflo
    Posted 9 years ago #

    Include the snoopy class and do this:

    $snoopy = new snoopy;
    echo $snoopy->results;

  9. 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.

  10. meatberg
    Posted 9 years ago #


    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 : )

Topic Closed

This topic has been closed to new replies.

About this Topic