I have enabled pop as well as imap on my gmail account which I am using for testing to read inbox using imap and pop in php.
However, I have successfully connected with other server and read emails from those server but gmail is blocking the connection and throwing the errors as given below:
imap_open(): Couldn't open stream {imap.gmail.com:993/imap/ssl}. Can't connect to imap.gmail.com,993: Connection timed out; Can't connect to imap.gmail.com,993: No route to host; Can't connect to imap.gmail.com,993: Network is unreachable