title: PHP Fatal error: Class 'Curl' not found with PHP 5.5
body: <p>I'm trying to run this code:</p>
  
  <pre><code>&lt;?php 
  
      $url = 'https://api.stackexchange.com/2.1/comments';
      $data = array("site" =&gt; 'graphicdesign', "key" =&gt; "W*i*e*V*M*N*F*y*b*t*R*((", "filter" =&gt; "!2.5sIHWRkCVWC)rFPY_1P", "order" =&gt; "desc", "sort" =&gt; "creation");
  
      $httpresponse = (new Curl)-&gt;exec($url . '?' . http_build_query($data), [CURLOPT_ENCODING =&gt; 'gzip']); //Line 6
  
      $obj = json_decode($httpresponse);
      $response = $obj-&gt;{'items'};
  </code></pre>
  
  <p>However, it fails with this error:</p>
  
  <pre><code>$ php getcomments.php 
  PHP Fatal error:  Class 'Curl' not found in /home/me/gdcommentgetter/getcomments.php on line 6
  </code></pre>
  
  <p>From <a href="https://stackoverflow.com/questions/20256042/why-does-this-php-code-run-on-one-machine-and-fail-on-another">my previous question</a>, I though it might be a problem with my PHP version - class member access on instantiation <code>((new Object)-&gt;method())</code> <a href="https://stackoverflow.com/a/20256057/1849664">wasn't available until PHP 5.4.</a></p>
  
  <p><code>php --version</code>, though, shows that I'm on a version > 5.4:</p>
  
  <pre><code>$ php --version
  PHP 5.5.7-1+sury.org~precise+1 (cli) (built: Dec 12 2013 21:48:51) 
  Copyright (c) 1997-2013 The PHP Group
  Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
      with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies
  </code></pre>
  
  <p>I've run <code>sudo apt-get install php5-curl</code>, as suggested many places, but it still fails with the same error. What's wrong?</p>