title: Connecting to Gmail IMAP PHP "Couldn't open stream"
body: <p>There are lots of people having similar issues but no one is answering their questions. I have IMAP enabled in PHP, Using all the correct information. I don't see where I'm going wrong.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>$hostname = '{imap.gmail.com:995/imap/ssl/novalidate-cert}'; 
  $username = 'emailaddress@gmail.com'; $password = 'password'; 
  $inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error());
  
  print_r(imap_errors());
  </code></pre>
  
  <p>Not returning any errors other than:</p>
  
  <blockquote>
    <p>Warning: imap_open() [function.imap-open]: Couldn't open stream
    {imap.gmail.com:995/imap/ssl/novalidate-cert} in
    /home/a8066360/public_html/test/imap.php on line 6</p>
    
    <p>Cannot connect to Gmail: Can't connect to gmail-imap.l.google.com, 995:
    Connection timed out</p>
  </blockquote>
  
  <p>I've noticed that if I change the single quotes to ` 
  
  <blockquote>
    <p>shell_exec() has been disabled for security reasons...</p>
  </blockquote>
  
  <p>Please help!!!</p>