title: PHP saves the png file as a 0 byte to disk
body: <p>My intention is save the generated qr code image on my local. </p>
  
  <p>I have already checked out whole stackoverflow question about it. However they didn't help me to solve this bug. </p>
  
  <pre><code>&lt;?php 
      header('Content-type: image/png');
  
      $filename = "./qrs/qr-6234/qr.png";
      $link = "https://stackoverflow.com";
      $size = 250;
      $url = urlencode ( $link );
      $qr_url = "http://chart.googleapis.com/chart?chs=$sizex$size&amp;cht=qr&amp;chld=L|0&amp;chl=$url&amp;choe=UTF-8";  
      $qr = file_get_contents($qr_url);
      $imgIn = imagecreatefrompng ($qr);
      $imgOut = imagecreate ( $size, $size );
      imagecopy ( $imgOut, $imgIn, 0, 0, 0, 0, $size, $size );
      imagepng ( $imgOut, $filename, 9);
      imagedestroy ( $imgIn );
      imagedestroy ( $imgOut );
  ?&gt;
  </code></pre>
  
  <p>I don't know why but, it gives me zero byte png file. </p>
  
  <p><strong>Edit:</strong> Thanks to ishagg, I got my error logs. These are ;</p>
  
  <pre><code>Warning: file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in ./qr/qr_txt_test.php on line 10
  
  Warning: file_get_contents(http://chart.googleapis.com/chart?chs=250&amp;cht=qr&amp;chld=L|0&amp;chl=https%3A%2F%2Fstackoverflow.com&amp;choe=UTF-8): failed to open stream: no suitable wrapper could be found in ./qr/qr_txt_test.php on line 10
  
  Warning: imagecreatefromstring(): Empty string or invalid image in ./qr/qr_txt_test.php on line 11
  
  Warning: imagecopy() expects parameter 2 to be resource, boolean given in ./qr/qr_txt_test.php on line 13
  
  Warning: imagepng(): gd-png error: no colors in palette in ./qr/qr_txt_test.php on line 14
  
  Warning: imagedestroy() expects parameter 1 to be resource, boolean given in ./qr/qr_txt_test.php on line 15
  </code></pre>