Categories
PHP / MySQL

Facebook login with PHP

Create a Facebook App

  • Goto https://developers.facebook.com/apps and click add new app
  • Choose Website
  • Choose the name for your facebook app , enter your email address and choose the category and click Add new app
  • Select setting from sidebar add your website URL in Site URL form
  • Installation

    Now head over to your project folder and , run below command.

    Above composer command will pull the Facebook PHP SDK into your project directory under vendor folder.

    Now create a file called fb-config.php with below code

    Now create a file called login.php to show login link.

    Lets create a file called fb-callback.php with below code, we will redirect to this callback URL after user login dialog is called.

    By Arjun

    I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.

    1 reply on “Facebook login with PHP”

    Leave a Reply

    Your email address will not be published. Required fields are marked *