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

    Sounds like you should contact the sysadmin of your server... might be a DNS/networking/firewall issue. Since the page works fine from sources other than your server (e.g. your personal computer), it seems like the error is local (but most likely not PHP's fault).

      bradgrafelman wrote:

      Sounds like you should contact the sysadmin of your server... might be a DNS/networking/firewall issue. Since the page works fine from sources other than your server (e.g. your personal computer), it seems like the error is local (but most likely not PHP's fault).

      Thanks for the reply. We also thought it could be the allow_url_fopen was set to Off, but it is on so it should work. I sent a note to the system admins and hope to hear back soon. I'll post results once I have them unless someone here has another suggestion.

      Thanks again.

        bradgrafelman,

        You were on target... DNS issue at host.

        Thanks

          I think I should point out that you should NEVER include() a file from a remote URL:

          • If you think it's a good idea, then you probably don't understand what it does.
          • If you understand what it does and STILL think it's a good idea, you haven't considered the security implications
          • If you understand what it does and the security implications AND STILL think it's a good idea, you obviously have little care for your server's security.

          Just don't include() remote files. Ever. At all. Whatsoever.

          A good alternative might be to read the file into a variable and write that out using file_get_contents() and echo(). Alternatively, if it's likely to be too big to fit in memory, consider using stream_copy_to_stream (having opened php://stdout to write to the output)

          Mark

            Thanks for the input... I'm not responsible for this code... just helping a friend resolve the actual error. But I will make sure to pass it along and have them talk to the guy that did it for them.

            Thanks.

              Write a Reply...