title: PHP failed to open stream: Permission denied
body: <p>I have this script on server, and he worked a year.</p>
  
  <pre><code>$json_object = file_get_contents('https://graph.facebook.com/' . $page_id . 
  '/feed?fields=permalink_url&amp;limit=5&amp;access_token=' . $access_token);
  </code></pre>
  
  <p>Now hosting provider make something changes at server side and script doesnt work (on local server all continues to work). 
  I have next errors:</p>
  
  <pre><code>Warning: file_get_contents(***): failed to open stream: Permissions denied in ***.php on line 18
  
  Notice: Trying to get property of non-object in ***.php on line 26
  
  Warning: Invalid argument supplied for foreach() in ***.php on line 28
  </code></pre>
  
  <p>Im rewrite this script, with using curl instead file_get_contents:</p>
  
  <pre><code>// 1. init
  $ch = curl_init();  
  // 2. params
  curl_setopt($ch, CURLOPT_URL, "https://graph.facebook.com/****/feed?fields=permalink_url&amp;limit=5&amp;access_token=****");  
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);  
  curl_setopt($ch, CURLOPT_HEADER, 0);  
  // 3. get result  
  $output = curl_exec($ch);  
   echo $output;
   if ($output === FALSE) {  
      //Maybe error
      echo "cURL Error: " . curl_error($ch);  
      return;  
  }  
  // 4. close connection 
  curl_close($ch);  
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>cURL Error: couldn't connect to host
  </code></pre>
  
  <p>How to find a way to define this problem?</p>