How to install OAuth PHP module on cPanel
This post will help you to install OAuth PHP module on cPanel server. The OAuth extension provides a simple interface to interact with data providers using the OAuth HTTP specification to protect private resources.
Installation of OAuth PHP module using EasyApache 3
yum install pcre-devel pecl install https://pecl.php.net/get/oauth-1.2.3.tgz
Verify the installation using the following command:
php -m | grep OAuth
Installation of OAuth PHP module using EasyApache 4
We are using multiple PHP version on EasyApache4, so we need to install OAuth on each PHP version individually. Run the following commands to install Memcache module on different PHP versions.
Please note that you need to install pcre-devel before proceeding with the OAuth installation.
yum install pcre-devel
Now install PHP OAuth on your desired PHP version using PECL.
PHP 5.4
/opt/cpanel/ea-php54/root/usr/bin/pecl install https://pecl.php.net/get/oauth-1.2.3.tgz
You should add extension=oauth.so to php.ini
vim /opt/cpanel/ea-php54/root/etc/php.ini
Restart Apache:
service httpd restart
Verify using the following command:
/opt/cpanel/ea-php54/root/usr/bin/php -m | grep OAuth
PHP 5.5
/opt/cpanel/ea-php55/root/usr/bin/pecl install https://pecl.php.net/get/oauth-1.2.3.tgz
Add extension=oauth.so to php.ini
vim /opt/cpanel/ea-php55/root/etc/php.ini
Restart Apache:
service httpd restart
Verify using the following command:
/opt/cpanel/ea-php55/root/usr/bin/php -m | grep OAuth
PHP 5.6
/opt/cpanel/ea-php56/root/usr/bin/pecl install https://pecl.php.net/get/oauth-1.2.3.tgz
Add extension=oauth.so to php.ini
vim /opt/cpanel/ea-php56/root/etc/php.ini
Restart Apache:
service httpd restart
Verify using the following command:
/opt/cpanel/ea-php56/root/usr/bin/php -m | grep OAuth
PHP 7.0
/opt/cpanel/ea-php70/root/usr/bin/pecl install oauth
Add extension=oauth.so to php.ini
vim /opt/cpanel/ea-php70/root/etc/php.ini
Restart Apache:
service httpd restart
Verify:
/opt/cpanel/ea-php70/root/usr/bin/php -m | grep OAuth
PHP 7.1
/opt/cpanel/ea-php71/root/usr/bin/pecl install oauth
Add extension=oauth.so to php.ini
vim /opt/cpanel/ea-php71/root/etc/php.ini
Restart Apache:
service httpd restart
Verify:
/opt/cpanel/ea-php71/root/usr/bin/php -m | grep OAuth
That’s it!
If you like this post and wish to receive more articles from us, please like our FB page: Grepitout
Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.
For more details on our services, please drop us an E-mail at info@grepitout.com
Remember, in EasyAPache 4 setups, after this step:
/opt/cpanel/ea-php54/root/usr/bin/pecl install https://pecl.php.net/get/oauth-1.2.3.tgz
cd /opt/cpanel/ea-php54/root/etc/php.d <– Change PHP version to match (for 7.x, make filename "30-oauth.ini")
Then create a new file names oauth.ini and paste:
extension=oauth.so
Then restart httpd and /opt/cpanel/ea-php54/root/usr/bin/php -m | grep OAuth should work.
Thanks. This was helpful for getting OAuth installed in WHM with EasyApache 4 and PHP 5.5.