title: Fatal error: Call to undefined function imap_open() in PHP
body: <p>I am trying to access my gmail account through my localhost. However, I am getting the response:</p>
  
  <blockquote>
    <p>Fatal error: Call to undefined function imap_open()</p>
  </blockquote>
  
  <p>This is my code:</p>
  
  <pre><code>$hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
  $username = 'myid@gmail.com';
  $password = 'mypassword';
  
  /* try to connect */
  $inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' .imap_last_error());
  </code></pre>