Intermittent Google API PHP Errors when Retrieving Access Token

I have developing a PHP application that made calls to the Google API using the OAuth process to authorize the app and retrieve an Access Token and a Refresh Token.

This morning, after a few relatively minor code changes, the wheels fell off the entire application.  Baffled, I slowly rolled back my changes to the original point and yet the problem persisted – I logged in to the Google Developers Console to check I hadn’t gone over my quotas and that my app was still there and all was well.

I checked my database as OK, then started writing various echoes in my PHP code to show me the contents of variables and arrays for debugging purposes.

I scratched my head.

I scratched my chin.

Luckily for me, as it’s my companies own server, despite it being a shared (Plesk) hosting account I have full remote access.  I logged in to the server to start looking for problems but couldn’t see any.  The only odd thing I noticed was that some server related connectivity calls were being a bit temperamental too.

In the end I did what any self-respecting I.T. guy should have done first: I turned it off and on again – problem solved!

I’m posting this purely to remind myself and other PHP developers that sometimes you need to listen to that voice that tells you your code is OK and look elsewhere!

Bob McKay

About Bob McKay

Bob McKay works at Perfect Image, is a father, programmer and a self confessed techie-geek type.

Disclosure Policy

Bob on Google+

Leave a Reply

Your email address will not be published. Required fields are marked *