thusi02 Posted July 16, 2007 Share Posted July 16, 2007 Hi, I have ServerA running Solaris. I have a php script that goes out to a page and gets the source code using file_get_contents. However, from this server or any other server it is unable to get the html source code from this server. $source = file_get_contents("https://calendar.cs.sfu.ca"); Does not work for some reason. Can anyone please help. Is this ServerA's problem or is there something on the calendar server that has some issues that is preventing me from getting the source? Is there any other way to get the source code for a page in php? This is the error that I get: Warning: file_get_contents(https://calendar.cs.sfu.ca/month.php?year=2007&month=: failed to open stream: No such file or directory in /PATH/TO/SCRIPT/on/SERVERA on line 17 cheers, Thusjanthan K. Quote Link to comment https://forums.phpfreaks.com/topic/60259-solved-file_get_contents-error-failed-to-open-stream-no-such-file-or-directory-in/ Share on other sites More sharing options...
Wildbug Posted July 16, 2007 Share Posted July 16, 2007 If allow_url_fopen is false/off, you won't be able to use the http(s):// wrappers. If it's your server, you can turn it on. Check phpinfo() or php.ini or ini_get('allow_url_fopen'). Cf. http://www.php.net/manual/en/wrappers.php Quote Link to comment https://forums.phpfreaks.com/topic/60259-solved-file_get_contents-error-failed-to-open-stream-no-such-file-or-directory-in/#findComment-299815 Share on other sites More sharing options...
thusi02 Posted July 16, 2007 Author Share Posted July 16, 2007 If allow_url_fopen is false/off, you won't be able to use the http(s):// wrappers. If it's your server, you can turn it on. Check phpinfo() or php.ini or ini_get('allow_url_fopen'). Cf. http://www.php.net/manual/en/wrappers.php Hi Cf, I have allow_url_fopen on for both servers. allow_url_fopen On On. Any other things that I can try? Which machine do you think is the problem: calendar.cs.sfu.ca or serverA? Thusjanthan Quote Link to comment https://forums.phpfreaks.com/topic/60259-solved-file_get_contents-error-failed-to-open-stream-no-such-file-or-directory-in/#findComment-299891 Share on other sites More sharing options...
thusi02 Posted July 16, 2007 Author Share Posted July 16, 2007 Found the problem. The problem was that ServerA that is calling the calendar.cs.sfu.ca page doesn't have https as one off the registered streams for php. Thus it croaks. So using http instead of https works Cheers, Thusjanthan Kubendranathan Quote Link to comment https://forums.phpfreaks.com/topic/60259-solved-file_get_contents-error-failed-to-open-stream-no-such-file-or-directory-in/#findComment-299910 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.