Using Facebook PHP SDK 4.0 with composer
From the video: https://www.youtube.com/watch?v=N6dT0AKSvok
Create a new directory where the facebook api project is suppose to be.
Create a new folder in the directory called vendor.
Run CMD and navigate to the directory.
To reverse to C:// type cd\ || To navigate forward, type cd
For example: cd xampp/htdocs/fbfile
Test run composer by typing composer. Once you see a whole list of commands, or that it doesn’t say the system does not recognize said command, all is good.
Back in the editor, create a composer.json. file. Key in the following in the file. { "require" : { "facebook/php-sdk-v4" : "4.0.*" } }
Save and return to the CMD.
Type composer install, then wait till everything is downloaded and installed.
To use the loaded composer dependencies, just do php require_once ‘autoload.php’; in the index.php file.







