OAuth support isn't included with PHP. It's the developer's responsibility to install an appropriate package.
-
https://packagist.org/packages/eher/oauth
This is the package used by the example code in this repository. Its API isn't well-documented, but it wasn't difficult to figure out.
-
https://packagist.org/packages/lusitanian/oauth
This package was considered for this example, but its API wasn't as easy to understand as that of eher/oauth. It may be worthwhile to further investigate using this package, considering its higher popularity. (1,126,505 downloads for this package, versus 130,129 for eher/oauth.) This package's popularity partly comes from its inclusion of code for using OAuth 2.0 with many popular services.
-
https://pecl.php.net/package/oauth
This package requires the PHP source code to compile it and special user privileges to install it.
-
https://pear.php.net/package/HTTP_OAuth
This is a pure-PHP OAuth package. Although it doesn't need to be compiled, it still needs special user provileges to install it.