I am really having a problem with the facebook login with codeigniter.

I am getting the login part, session and db query execution working just fine, but sometimes i keep getting a facebook api exception error screen.

How can i get rid of this? Is there any work around for this?

I dont want this to happen on my production server.

An uncaught Exception was encountered.
Type: FacebookApiException
Message: failed to connect to graph.facebook.com port 443: Network unreachable

Try to increase the timeout. If you're using curl, then increase the values of connect_timeout and timeout, default should be 30 seconds.