Group: Member 
Post Group: Newbie
Posts: 1
Status: 
|
Hi, i'm newbie. I want to ask if amppstack supports curl, especially the code below.
$params = [
'code' => $_GET['code'],
'client_id' => $google_oauth_client_id,
'client_secret' => $google_oauth_client_secret,
'redirect_uri' => $google_oauth_redirect_uri,
'grant_type' => 'authorization_code'
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https(:/)/accounts(.)google(.)com/o/oauth2/token');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$response = json_decode($response, true);
i want to create login function with google. It runs fine on XAMPP but not AMPPS. $response returns a NULL value.
sorry for my English not good. Tks for support.
|