...

View Full Version : failed to open stream: No route to host in...



gsaunders
07-01-2007, 03:58 AM
I have a client which is seeing the following error from this code in WordPress:


<?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

_Aerospace_Eng_
07-01-2007, 04:02 AM
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.

gsaunders
07-01-2007, 04:29 AM
The remote link they are including is designed to be pulled so they shouldn't be stopping it.

_Aerospace_Eng_
07-01-2007, 04:34 AM
Post the code for page.php

gsaunders
07-01-2007, 04:36 AM
<?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>

Mwnciau
07-01-2007, 04:38 AM
If "URL fopen wrappers (http://uk.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen)" 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

gsaunders
07-01-2007, 04:41 AM
I'll double check... this code has been working on my customers site for a while... it just stopped recently.

_Aerospace_Eng_
07-01-2007, 04:42 AM
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.

gsaunders
07-01-2007, 04:50 AM
The server has allow_url_fopen on.

Used phpinfo.php to get the results.

gsaunders
07-01-2007, 05:19 AM
Problem resolved... DNS issue at host.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum