Well fuck me.
Remember that problem with the WordPress OpenID plugin? The one that I just couldn’t solve, because the PHP OpenID library is so fucking obtuse? The one that I spent days and days on, just kinda randomly dumping out variables? The one that worked on my local site but none of my hosted domains? That one?
Well, I fixed it. Kinda.
After a lot of dicking about and literally hundreds of emails filled with dumped variablesi I finally narrowed the issue down to somewhere around _httpResponseToMessage() in Consumer.php. Oddly, I noticed that each time I made an OpenID authorisation request, this function would run twice. Once with “real” return data, and one subsequent to that with some kind of error message. Oh-kay, thinks I. So I went and enabled WP_DEBUG.
Cue massive weirdness, and suddenly a whole host of “MySQL server has gone away” errors when trying to update the plugin’s table data. Lol whut?
So in what I thought was a stroke of debugging genius (ha-hah!), I compared the vardumps from the failed run at β with the successful run on my local machine. The difference? My local machine is running as session_type:no-encryption, while β is trying for session_type:DH-SHA1.
WP-OpenID’s handy status pane reveals that this seems to be caused by my local machine’s version of PHP having no capacity for big integer mathematics.ii Meanwhile, β is trying to use the BCMath library. WP-OpenID recommends GMP.iii
Well, installing GMP isn’t really an option, but forcing the plugin to run with no encryption (“dumb mode“) is. So I hacked up lines 106-108 of OpenID.php to force Auth_OpenID_setNoMathSupport(), even if Auth_OpenID_getMathLib() evaluates.
Viola! We have OpenID liftoff.
Anyway, the point of this is:
- To remind me what to do when I next update the plugin and it breaks again; and
- To inform those of you with OpenIDs (read: LiveJournals) that you may now comment/login using solely your OpenID URL. Hopefully.
I find it kind of scary that, despite the site still being in closed beta, my user ID at Dreamwidth is still higher than my user ID at LiveJournal.
The internet is a much, much bigger place nowadays than it was ten years ago…
557 days ago
12 comments