jeff00seattle Posted September 20, 2009 Share Posted September 20, 2009 Take this simple PHP script which gets contents from a website: $response = file_get_contents(http://www.google.com); If I call this script within a PHP file as a script through Eclipse PDT, it provides a response. If I call this script within the same PHP file was a webpage through IIS 7, it provides no response (false). If I run this same script on the same box in WAMP, no problems. The same is true if I use PHP cURL functionality. $ch = curl_init(); $timeout = 0; curl_setopt ($ch, CURLOPT_URL, 'http://www.google.com'); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $response = curl_exec($ch); curl_close($ch); Jeff in Seattle Quote Link to comment https://forums.phpfreaks.com/topic/174859-network-response-problem-with-php-commands-curl-file_get_contents-in-iis-7/ Share on other sites More sharing options...
trq Posted September 20, 2009 Share Posted September 20, 2009 All the variants you describe rely on there own individual php.ini file. Check that the valid file for use with IIS7 has valid url wrappers enabled. Quote Link to comment https://forums.phpfreaks.com/topic/174859-network-response-problem-with-php-commands-curl-file_get_contents-in-iis-7/#findComment-921523 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.