Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    failed to open stream: No route to host in...

    I have a client which is seeing the following error from this code in WordPress:
    PHP Code:
    <?php
    include ('http://app.feeddigest.com/digest3/ODC9FIC36I.html');
    ?>
    Error:
    Warning: main(http://app.feeddigest.com/digest3/ODC9FIC36I.html) [function.main]: failed to open stream: No route to host in /hsphere/local/home/user/mydomain.com/wp-content/themes/anaconda/page.php on line 18

    Warning: main(http://app.feeddigest.com/digest3/ODC9FIC36I.html) [function.main]: failed to open stream: No route to host in /hsphere/local/home/user/mydomain.com/wp-content/themes/anaconda/page.php on line 18

    Warning: main() [function.include]: Failed opening 'http://app.feeddigest.com/digest3/ODC9FIC36I.html' for inclusion (include_path='.:/usr/local/lib/php') in /hsphere/local/home/user/mydomain.com/wp-content/themes/anaconda/page.php on line 18
    They said it was working and now is not working. Any php experts no what the error represents?

    I can manually open the link so I know the link itself is valid.

    Thanks

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Sounds like the server that the file is on is preventing people from including it by closing a port on their server.
    Scratch that as I can include the file just fine on my server. Hmm perhaps your webhost has changed some settings.
    Last edited by _Aerospace_Eng_; 07-01-2007 at 04:20 AM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Nov 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The remote link they are including is designed to be pulled so they shouldn't be stopping it.

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Post the code for page.php
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New Coder
    Join Date
    Nov 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    <?php 
    /* This file is Modified from K2 on 25th July 2006. */
    ?>

    <?php get_header(); ?>

        <div id="content-wrap">
        
            <div id="sidebar">
                 <?php include (TEMPLATEPATH '/leftsidebar.php'); ?>
            </div>  
        
            <div id="content">
                <?php if (have_posts()) { while (have_posts()) { the_post(); ?>

                <div class="item">
    <?php
    include ('http://app.feeddigest.com/digest3/ODC9FIC36I.html');
    ?>
        
                    <div class="pagetitle">
                        <h2 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title='Permanent Link to "<?php the_title(); ?>"'><?php the_title(); ?></a></h2>
                        <?php edit_post_link('<img src="'.get_bloginfo(template_directory).'/images/pencil.png" alt="Edit Link" />''<span class="editlink">''</span>'); ?>
                    </div>
                
                    <div class="itemtext">
                        <?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
            
                        <?php link_pages('<p><strong>Pages:</strong> ''</p>''number'); ?>
                    </div>
        
                </div>
        
                <?php ?>
                <?php /* If there is nothing to loop */  } else { $notfound '1'/* So we can tell the sidebar what to do */ ?>
                
                    <div class="center">
                        <h2>Not Found</h2>
                    </div>
                
                    <div class="item">
                    <div class="itemtext">
                        <p>Oh no! You're looking for something which just isn't here! Fear not however,
                        errors are to be expected, and luckily there are tools on the sidebar for you to
                        use in your search for what you need.</p>
                    </div>
                    </div>
        
                <?php /* End Loop Init */ ?>
                <div id="footer">
                    <?php get_footer(); ?>
                </div>              
            </div>
            
            <div id="utility">
                <?php get_sidebar(); ?>
            </div>  
            
        </div>
    </div>
    </body>
    </html>

  • #6
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using a URL (via HTTP or other supported wrapper - see Appendix O, List of Supported Protocols/Wrappers for a list of protocols) instead of a local pathname.
    Check if that is enabled/disabled

  • #7
    New Coder
    Join Date
    Nov 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'll double check... this code has been working on my customers site for a while... it just stopped recently.

  • #8
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I to thought that might be the issue so I disabled it on my server but it doesn't return the same error.
    As I said before it sounds like your web host changed something in their server settings. Attached is a recommended php.ini file, upload it to your root directory and see if it fixes anything.
    Attached Files Attached Files
    Last edited by _Aerospace_Eng_; 07-01-2007 at 05:23 AM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #9
    New Coder
    Join Date
    Nov 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The server has allow_url_fopen on.

    Used phpinfo.php to get the results.

  • #10
    New Coder
    Join Date
    Nov 2005
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Problem resolved... DNS issue at host.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •