We’re thrilled to announce EarlyDog, our fully managed hosting on Google Cloud servers EarlyDog: managed hosting on Google Cloud

← ServerPilot Docs

How to Install the PHP OAuth Extension

In the examples shown, replace "5.X" or "7.X" with your app's PHP version (for example, "5.4" or "7.1"). To install a PECL extension for multiple PHP versions, repeat the PECL extension installation for each PHP version.

OAuth

The OAuth extension provides OAuth consumer and provider bindings. OAuth is an authorization protocol built on top of HTTP which allows applications to securely access data without having to store usernames and passwords.

Installing OAuth on PHP 7.0, 7.1, 7.2, or 7.3

To install this extension on PHP 7.X, run the following commands as your server's root user:

sudo apt-get -y install gcc make autoconf libc-dev pkg-config libpcre3-dev
sudo pecl7.X-sp install oauth

Once installed, create a configuration file for the extension and restart PHP by running the following commands as root:

sudo bash -c "echo extension=oauth.so > /etc/php7.X-sp/conf.d/oauth.ini"
sudo service php7.X-fpm-sp restart

Installing OAuth on PHP 5.4, 5.5, or 5.6

To install this extension on PHP 5.X, run the following commands as your server's root user:

sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo pecl5.X-sp install oauth-1.2.3

Once installed, create a configuration file for the extension and restart PHP by running the following commands as root:

sudo bash -c "echo extension=oauth.so > /etc/php5.X-sp/conf.d/oauth.ini"
sudo service php5.X-fpm-sp restart

Verifying the Installation

You can verify the oauth extension is installed correctly by running this command:

phpX.Y-sp -i | grep -i "OAuth"

You should see output like the following:

OAuth
OAuth support => enabled

Uninstalling the OAuth Extension

To uninstall this extension, as root run the commands:

sudo rm /etc/phpX.Y-sp/conf.d/oauth.ini
sudo peclX.Y-sp uninstall oauth

Next, restart PHP-FPM with the command:

sudo service phpX.Y-fpm-sp restart
Last updated: May 27, 2020

Launch your first site in 5 minutes