PHP error with oauth2

Yes.

I've followed this tutorial

...and made some fixes (as per my sharing above)