PHP Fatal error: Class 'OAuth'

感情迁移 提交于 2019-12-03 20:18:14

From the error, you're not importing the oauth package in you php.ini file. For ubuntu, you need to install oauth:

sudo pecl install oauth

Then include the oauth package in your php.ini. If you don't know where the file is, you can use:

sudo find / -name "oauth.so"

Using the path to the extension add the following to your php.ini:

extension=/path/to/oauth/package/oauth.so

Restart apache and try again.

Ensure that the extension is actually loaded. To verify that it is, simply ask PHP something about the OAuth extension, in a command like:

php --re oauth

If this doesn't show information about the module but instead gives an error, you'll know that it's not loaded. Additionally you could simply list all loaded modules with php -m.

Try manually loading the extension by using -z oauth in your command. Example: php -z oauth example.php. If that works, you didn't edit your php.ini correctly.

lx24

The command php --re oauth solved my issue.

Seems there was some miss coding with php.ini. the command gives me error, I removed those lines and re-install oauth, restarted httpd and it loads that extension successfully.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!