WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] PHP Include on 1.5 (3 posts)

  1. Stuarts
    Member
    Posted 8 years ago #

    Hi,

    Ok. I am running a WordPress 1.5 install.

    I would like to include a php include in the sidebar of my site that would display a random set of links to other sites that I specify.

    To do this I am using a program called linkwit which generate the links on another site, and then creates the include code to be inserted on whatever other website you like.

    The code it produces is as follows:

    <?php $u=urlencode('http://'.getenv("HTTP_HOST").getenv("SCRIPT_NAME"));
    readfile("http://www.mynormaldomain.net/cgi-bin/linkwit/linkwit/ilc?tmplid=60906671001121771069&siteid=03620791001136513787&num=5&rmax=5000"); ?>

    Now, I have tried placing this in the sidebar.php of my other wordpress site, but it doesn't work.

    Instead it comes back with:

    function iinclude_page ( int $post_id, [
    Warning: readfile(): URL file-access is disabled in the server configuration in /usr/www/users/vitalart/www.mywordpressdomain.com/wp-content/themes/td-theme/sidebar.php on line 40

    Warning: readfile(http://www.mynormaldomain.net/cgi-bin/linkwit/linkwit/ilc?tmplid=60906671001121771069&siteid=03620791001136513787&num=5&rmax=5000): failed to open stream: no suitable wrapper could be found in /usr/www/users/vitalart/www.mywordpressdomain.com/wp-content/themes/td-theme/sidebar.php on line 40
    ])

    Now, I don't want to use an iframe or javascript because then the links will not be spiderable by search engines.

    So I want to figure out how I can get the links to display using the php code above.

    Does anyone know how to do this? Or is there a plugin, or code I can use to get this to work?

    I have searched on the forum but haven't come up with a solution.

    Any help appreciated.

    Regards,

    Stuart

  2. Kafkaesqui

    Posted 8 years ago #

    This message:

    Warning: readfile(): URL file-access is disabled in the server configuration

    points to the PHP installation on your server not allowing remote document access. This would typically be set for security purposes. You'd have to contact your host to ask if they can allow it to your account, etc.

    EDIT: I guess I can pass along one thing to try: add this to your .htaccess file:

    php_flag allow_url_fopen on

    Note this can cause problems if the server does not support the php_flag directive.

  3. Stuarts
    Member
    Posted 8 years ago #

    Thanks very much for your help.

    That worked great!

    Stuart

Topic Closed

This topic has been closed to new replies.

About this Topic