views:

680

answers:

4
+6  Q: 

OpenID in PHP 5.3

Does anyone have openid working in a PHP 5.3 installation? None of the libraries I've tried seem to be working.

A: 

Zend_OpenId is compatible with PHP 5.3, however it only supports OpenID 1.1 and will not work with Google (which uses OpenID 2.0). Janrain's OpenID system normally available via http://openidenabled.com/php-openid/ is the one I'm using for my PHP 5 application (the OpenID enabled site is currently slightly down for maintenance today) - it is also one of the more popular PHP OpenID implementations (only small snag is that it uses temporary files for the OpenID sessions - making getting it working on a multi-server environment slightly tricky).

Richy C.
Right, I'm not going to use an openid 1.1 provider. And Janrain was NOT working on PHP 5.3 for me. Does it work for you?
Paul Tarjan
Yes, what sort of problem/errors are you having?
Richy C.
These are the error messages. http://gist.github.com/167039
Paul Tarjan
Any idea about my errors?
Paul Tarjan
+2  A: 

The solution is to remove all the of pass-by-reference elements in php-openid.

change

foo(&$param)

to

foo($param)

and the library should work again.

Paul Tarjan
That, and the suggestions in [this ticket](http://trac.openidenabled.com/trac/ticket/337) of openidenabled.com make the library work partially. However, that will not fix the library completely and the authentication with Google will not work.
miguelSantirso
google logins seem to work for me with this change : http://paulisageek.com/openidavatar/
Paul Tarjan
Ok, I finally fixed it... I explain everything in my answer to this question
miguelSantirso
+4  A: 

Ok, I finally got to fix the library... I explained everything here (you can also download the php-openid library after my changes).

I needed to do what Paul Tarjan suggested but, also, I needed to modify the Auth_OpenID_detectMathLibrary and add the static keyword to a lot of functions. After that It seems to work perfectly although it is not an ideal solution... I think that someone should rewrite the whole library in PHP 5...

miguelSantirso
A: 

Could anyone post a working library or patch somewhere? I have seen several different patches, but none of them work 100%.

Mart Randala