Welcome Guest. Please Login or Register  


You are here: Index > Softaculous Auto Installer > General Support > Topic : cURL



Threaded Mode | Print  

 cURL, Does Amppstack support curl (1 Replies, Read 49198 times)
timduongdi123123
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.
IP: --   

cURL
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5728
Status:
Hi,

Yes AMPPS does support curl extension.

You can try adding :
echo curl_error($ch);

before curl_close() and check the output for any errors.

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
6 guests, 0 users.


All times are GMT. The time now is October 31, 2024, 11:41 pm.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 10  |  Page Created In:0.026