0

I am using an open source library ( http://hybridauth.sourceforge.net ) that does not support the PECL OAuth extension of PHP. If you try to run code with it, it says "Exception: Hybridauth Library not compatible with installed PECL OAuth extension. Please disable it."

Easier said than done.

I am hosting my site via Amazon AWS Elastic Beanstalk ( https://aws.amazon.com/elasticbeanstalk/ ). I chose this solution because it allows you to get started quickly with no configuration, no SSH, no custom AMI, ...

Which means I can't easily modify the original php.ini file or delete the extension file.

Is there an easier way? Disabling an extension on the fly? Via a php method? Via an htaccess file? A trick?

Naftali
  • 144,921
  • 39
  • 244
  • 303
Nathan H
  • 48,033
  • 60
  • 165
  • 247
  • I may have found a workaround so far ... fixing HybridOAuth so it doesn't prevent you from having this extension. Now of course maybe I broke something else elsewhere... – Nathan H Nov 07 '12 at 17:14
  • Hi Nathan, What was your solution for this in the end? I've run into the same problem. – goose Feb 14 '14 at 21:37
  • This was a long time ago... I posted my solution on their github, but it seems they've disabled public issues. I found someone online quoting me here: "Basically, in the Hybrid/thirdparty/OAuth/Oauth.php file, I replaced every instance of OAuthException with HOAuthException. Then in the Hybrid/auth.php file I commented out the exception being thrown for the Oauth PECL extension (lines 116-120). I haven't done extensive testing yet, but so far it seems to be working." And I confirm, it mostly worked. – Nathan H Feb 16 '14 at 09:24
  • Thanks Nathan, that solved the initial problem. Unfortunately only to reveal another issue that seems to already have been asked here: http://stackoverflow.com/questions/18655472/you-cannot-access-this-page-directly-hybridauth-social-login/18976083#comment33005629_18976083 – goose Feb 16 '14 at 17:40
  • I've had it as well, and for me it was related to sessions that did not save correctly. – Nathan H Feb 19 '14 at 12:18

3 Answers3

2

No, you cannot disable extensions via PHP method call. In the past you could add it (with dl()), but even then, you was not able to remove any added without playing with ini file.

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
0

The short version: No, not in any practical sense.

If you have runkit available you should be able to remove the functions or objects that the module defines, but it really depends on why HybridAuth have trouble working when the PECL OAuth extension is installed. This is not suggested for anything close to a production environment.

MatsLindh
  • 49,529
  • 4
  • 53
  • 84
0

You can ssh into your instance very easily if you have your pem key. Just go to the ec2 console, select your instance and click "connect" in the toolbar to get the address. Then you can modify any of the files on the server.

ryanovas
  • 402
  • 1
  • 5
  • 11