DWChrisG

Member
Aug 10, 2017
12
1
3
Greece
cPanel Access Level
Root Administrator
Hello there,

A random question - Is there any guide available on how to fully install Oauth on WHM/Cpanel?

I guess, I have already installed it via Module Installer? (Software » Module Installers).. At least it shows as installed on every php version..

Thing is.. Whenever I try to call the said function from a php file.. I am getting the usual, class not found error..

Code:
Fatal error: Class 'OAuth' not found in ...
Am I missing something?

Thank you for your time
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,213
363
Hello @DWChrisG,

PHPINFO files are useful for checking of a PHP module is installed. You can use your preferred file management method (e.g. SSH, FTP, File Manager) to create a file named phpinfo.php in the domain’s document root (e.g. /home/username/public_html/). The file should contain the following lines:

Code:
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>
Ensure the phpinfo.php file is configured with 0644 permissions. User and group ownership should be set to the corresponding cPanel account’s username. Here's an example of how to do this via the command line:

Code:
chmod 0644 /home/username/public_html/phpinfo.php
chown username.username /home/username/public_html/phpinfo.php
Once the phpinfo.php file is created, you can open it by accessing domain.tld/phpinfo.php in your web browser and search the page for "OAuth" to see if it's listed. If it's not, look at the path to the "php.ini" file to see if you're using a custom php.ini file on the account.

Thank you.
 

DWChrisG

Member
Aug 10, 2017
12
1
3
Greece
cPanel Access Level
Root Administrator
What happens when you run?
/opt/cpanel/ea-php??/root/usr/bin/pecl install oauth
This installed the module, after a little manipulation on the .ini file (To allow popen)

For future ref, the .ini file is located here:
Code:
/opt/cpanel/ea-php??/root/etc/php.ini
Does it show up in your listed PHP modules ?
php -m | grep OAuth
/opt/cpanel/ea-php??/root/usr/bin/php -m | grep OAuth
After installing the module, this popped up "OAuth", showing it as installed, in the installed modules listing..

Much appreciated, both of you guys for your time and solution :)
 
  • Like
Reactions: cPanelMichael