Applicable to:
- Plesk for Linux
Question
How to install the OAuth PHP extension for Plesk PHP?
Answer
Note: In the example below, the OAuth PHP extension is installed for PHP version 7.4 provided by Plesk. For other PHP versions, replace "7.4" with a required PHP version. Refer this guide to install additional PHP versions.
-
Connect to a Plesk server via SSH.
-
Install the packages required for OAuth installation:
-
on CentOS/RHEL-based distributions:
# yum install plesk-php74-devel make gcc php-pear pcre-devel
-
on Debian/Ubuntu-based distributions:
# apt-get install plesk-php74-dev gcc make autoconf libc-dev pkg-config
-
-
Install OAuth:
# /opt/plesk/php/7.4/bin/pecl install oauth
-
Enable the extension:
# echo extension=oauth.so > /opt/plesk/php/7.4/etc/php.d/oauth.ini
-
Verify that OAuth is now enabled:
# /opt/plesk/php/7.4/bin/php -m | grep OAuth
OAuth -
Refresh the information about PHP handlers in Plesk:
# plesk bin php_handler --reread
-
Refresh the information about server components in Plesk:
# plesk sbin packagemng -sdf
This extension will also appear in Plesk at Tools & Settings > PHP Settings > 7.4 any application.
Comments
7 comments
This is a partial solution. Installs yes, but curl is not included as a Request Engine, only streams
Hello Jack Lee,
The solution provided in this guide works 100% but indeed uses phpstreams as request engine yes.
If you want to change to curl request engine you may try the steps for example as shown here https://talk.plesk.com/threads/curl-request-engine-for-php-oauth-extension.343224/
I suggest trying this in a non-production server just in case, as this hasn't been officially tested.
Hello,
Have tried this with 7.4 and while all looks good through install, Oauth is not showing up within 7.4 listing. Installing prior versions has worked out well, for some reason this version is not showing up after re-reading handler.
Is there any additional steps for this version?
Hello Chad,
Did you ever get this resolved. I'm also using 7.4 and have the same issue. Tried an extra step of adding the extension to the php.ini file but that didn't help. Also noticed that the extension doesn't appear on the Plesk Tools & Settings PHP Settings page as described.
Andrew
Hi Andrew,
Unfortunately no, while the extension did eventually show up within PHP Settings page - switching to 7.4 only lead to application errors. There seems to be something just a bit off here, as prior versions were not as tricky and run quite smooth. So possibly a compatibility issue that needs a little ironing out.
Chad
Hi Andrew Davis and Chad!
Thanks for your input.
We've updated the article with step 7, after which Oauth should appear in the list of installed extensions.
If PHP is running as FastCGI application served by Apache I can see that 0Auth is enabled. However for sites that have PHP running as FPM application server by nginx I can't see the 0Auth module being enabled. What am I overlooking?
Please sign in to leave a comment.