php imap获取连接失败错误

Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/imap/ssl}INBOX in /home/happy/public_html/source/imap/fet_mail_from_email_add.php on line 7
can't connect: Can't connect to gmail-imap.l.google.com,993: Connection timed out

my snippet is

$mbox = imap_open("{imap.gmail.com:993/imap/ssl}INBOX", "user@gmail.com","somesecretpassword") or die("can't connect: " . imap_last_error());

Like the error message point out there is a network timeout/connection failure happening.

Make sure any network equipment (Firewall, router with ACL, etc ...) don't disallow to connect to the TCP port 993.

You would probably make sure you can connect from the server to Gmail server using ssh and trying with telnet first, if that test is ok try with PHP.