The easiest way to install Facebook PHP SDK on Magento 2 is to use the composer. Run this CLI command, in Magento 2 folder to install it:

composer require facebook/graph-sdk 

If for some reason you cannot use the composer, then:

1. Download SDK version from Github.

2. Unzip archive.

3. Copy the folder


 from the arcive to


3. Edit file 


and add a new line to the file, e.g.:

return [
'lib/internal/Facebook/autoload.php', //new line

4. If registration_globlist.php does not exist, edit the file


and before

foreach ($pathList as $path) {

add this line of code

$pathList[] = dirname(dirname(__DIR__)) . '/lib/internal/Facebook/autoload.php';