qteks200 Posted October 17, 2008 Share Posted October 17, 2008 2 questions: 1) I have a windows server and a linux server. There is a file foo.txt in windows server which is accessible form http, it means you can see the contents of it via browsers with a URL such as : mydomain.com/foo.txt I tried to remotely read this file with php commands such as CURL, file_get_contents, fsockopen and ... . All work fine in localhost (Windows Vista php5 installed) and show me the contents of foo.txt in remote server, but when I run the same script on my linux server (redhat with php5 installed) the response was: 404 not found. It means windows server have to different behavior for browsing same page. And the prospected behavior is to view the contents of requested file. how do I solve it? I have full access to both Windows and Linux server. 2) I write down a php Web-Feed aggregator. It reads file from a remote server using CURL. The problem is some sites like feedburner.com after specified count of requests in specified time period, will redirect requested page to another page like feed proxy.feedburner.com/blablabla . How do I handle this redirection? Thanks, r.Sharafi Quote Link to comment https://forums.phpfreaks.com/topic/128847-problem-reading-remote-file/ Share on other sites More sharing options...
rhodesa Posted October 17, 2008 Share Posted October 17, 2008 1) What does your code look like? This shouldn't be a problem. You could also try using the IP address instead of the hostname. 2) Make fewer requests by caching the data locally. Quote Link to comment https://forums.phpfreaks.com/topic/128847-problem-reading-remote-file/#findComment-667963 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.