Craig Hopson Posted October 15, 2012 Share Posted October 15, 2012 OK so i have this snipit of code and it's making me look like a fool <?php$url="All other trademarks and material are the prop of their respectful owners";$site = file_get_contents("https://www.footle.net");if (strpos($site,$url) !== false) { echo 'GOOD'; } else { echo 'BAD';}?> Works fine on my server but my clients server gives this error Warning: file_get_contents(https://www.footle.net) [function.file-get-contents]: failed to open stream: No such file or directory in /usr/local/apache2/htdocs/test-1.php on line 3BAD PLEASE help me work round this Link to comment Share on other sites More sharing options...
justsomeguy Posted October 15, 2012 Share Posted October 15, 2012 It sounds like their server does not support the URL wrappers for fopen, it is looking for a local file instead of a URL. There are other ways to get that content (e.g., using the cURL library), but if one is disabled they might have all of those functions disabled for everyone. Link to comment Share on other sites More sharing options...
Craig Hopson Posted October 15, 2012 Author Share Posted October 15, 2012 (edited) ahh thank you i will check it THANKS edit :- allow_url_fopen =ON any other ideas? Edited October 15, 2012 by Craig Hopson Link to comment Share on other sites More sharing options...
Craig Hopson Posted October 15, 2012 Author Share Posted October 15, 2012 http://www.myworldconnect.com/test.php Link to comment Share on other sites More sharing options...
thescientist Posted October 15, 2012 Share Posted October 15, 2012 (edited) could have something to do with https, maybehttp://stackoverflow...ents-with-https if not, JSG already suggested cURL as an alternative Edited October 15, 2012 by thescientist Link to comment Share on other sites More sharing options...
oldscholar Posted October 15, 2012 Share Posted October 15, 2012 It seems that It can't get the file its trying to open. Please use fopen instead to test thouroughly.http://www.php.net/manual/en/function.fopen.php Link to comment Share on other sites More sharing options...
birbal Posted October 15, 2012 Share Posted October 15, 2012 fopen and file_get_contents() uses same wrappers. so if it is not working with one, will not work with either for same reason. Link to comment Share on other sites More sharing options...
JohnTipperton Posted October 19, 2012 Share Posted October 19, 2012 (edited) i suggest you use http://www.000webhost.com/ for your hosting they allowallow_url_fopen =ONmost free hosting doesnt allow it so better try it. Edited October 19, 2012 by JohnTipperton Link to comment Share on other sites More sharing options...
Craig Hopson Posted October 19, 2012 Author Share Posted October 19, 2012 I have found the problem to be open ssl not installed Link to comment Share on other sites More sharing options...
birbal Posted October 19, 2012 Share Posted October 19, 2012 that boils down to the solution thescintist said. you can still use http:// without secure conection to get conetnts of the file. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now