micah1701 Posted September 9, 2009 Share Posted September 9, 2009 I have allow_url_fopen turned on yet: <?php if(!file("http://www.google.com") ){ echo "boo hiss, this doesn't work"; } ?> using file() is returning false. for that matter, so is fopen() and file_get_contents() is there some other setting I'm missing other then "allow_url_fopen" that might be blocking my XSS? Quote Link to comment https://forums.phpfreaks.com/topic/173670-solved-any-ideas-why-file-function-isnt-working/ Share on other sites More sharing options...
TeNDoLLA Posted September 9, 2009 Share Posted September 9, 2009 How about <?php if(!file("http://www.google.com/") ){ echo "boo hiss, this doesn't work"; } Quote Link to comment https://forums.phpfreaks.com/topic/173670-solved-any-ideas-why-file-function-isnt-working/#findComment-915461 Share on other sites More sharing options...
micah1701 Posted September 9, 2009 Author Share Posted September 9, 2009 no such luck. the script works when run of another host so I'm thinking it might not be the code but the configuration settings? or not? Quote Link to comment https://forums.phpfreaks.com/topic/173670-solved-any-ideas-why-file-function-isnt-working/#findComment-915464 Share on other sites More sharing options...
TeNDoLLA Posted September 9, 2009 Share Posted September 9, 2009 Maybe check if theres any hints in php's error log or web servers error log? Quote Link to comment https://forums.phpfreaks.com/topic/173670-solved-any-ideas-why-file-function-isnt-working/#findComment-915467 Share on other sites More sharing options...
micah1701 Posted September 9, 2009 Author Share Posted September 9, 2009 good thinking... I'm getting two warnings: Warning: file() [function.file]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /path/to/my/file.php line # and Warning: file(http://www.google.com/) [function.file]: failed to open stream: Resource temporarily unavailable in /path/to/my/file.php line # guess I'll go google those; maybe someone here can respond back in the meantime with a good interpretation. Quote Link to comment https://forums.phpfreaks.com/topic/173670-solved-any-ideas-why-file-function-isnt-working/#findComment-915472 Share on other sites More sharing options...
micah1701 Posted September 9, 2009 Author Share Posted September 9, 2009 hmm, this is starting to look more like a server configuration issue. getting help from my web host is like pulling teeth :'( Thanks for the help anyway. Quote Link to comment https://forums.phpfreaks.com/topic/173670-solved-any-ideas-why-file-function-isnt-working/#findComment-915484 Share on other sites More sharing options...
premiso Posted September 9, 2009 Share Posted September 9, 2009 If you are on shared hosting, most of the time they disable the retrieval of files through fopen items, such as file. You can try using curl to retrieve the contents and see if that will work, that is if your host has curl installed. Quote Link to comment https://forums.phpfreaks.com/topic/173670-solved-any-ideas-why-file-function-isnt-working/#findComment-915495 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.