In redirect_uri you should set link on your site(for example: http://localhost/facebook-auth).
So you will get request like this one:
http://localhost/facebook-auth/?code=AQD5q80zafjvVZoZex87ROxkCvWT9rZhjwZtkBLajYwH20KztPOI0jpb5lHZisPd3mA49Wu_onAeEioU5K6KVuoCliznf61B5bDfZSLFaIn6E7E49zqs4fO6NjTYyxN43LBttCvsSlirJOAtbOpB3oyMrl3bbjlPhGHsCyJzA-DypEIZ1c_36WAEBPmfSq3TroekvTLme3jIzZk0C-93cu8z#_=_
This code param you need to get the token.
Your next query will be like:
$params = array(
'client_id' => $client_id,
'redirect_uri' => $redirect_uri,
'client_secret' => $client_secret,
'code' => $_GET['code']
);
$url = 'https://graph.facebook.com/oauth/access_token';
And in response you will get the token