Hata : cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
SS :
8
●2.675
curl.cainfo = "C:\laragon\etc\ssl\cacert.pem"View dosyasında php kodlarının ne işi var orası ayrı bir konu.
<?php
function customGuzzleClient( $googleClient ) {
$options = [
'base_uri' => $googleClient->getConfig( 'base_path' ),
'exceptions' => false,
'verify' => false,
];
return new GuzzleHttp\Client( $options );
}
// session_start();
require_once 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
$client = new Google_Client();
$client->setHttpClient( customGuzzleClient( $client ) );
$client->setAuthConfig( 'client_secrets.json' );
$client->setRedirectUri(
'http://' . $_SERVER[ 'HTTP_HOST' ] . '/saintx.php'
);
$client->addScope( Google_Service_Analytics::ANALYTICS_READONLY );
if ( empty( $_GET[ 'code' ] ) ) {
header( 'Location: ' . $client->createAuthUrl(), true, 301 );
} else {
$client->authenticate( $_GET[ 'code' ] );
$_SESSION[ 'access_token' ] = $client->getAccessToken();
var_dump( $client->getAccessToken(), $_SESSION );
// header( 'http://' . $_SERVER[ 'HTTP_HOST' ], true, 301 );
}bunu dene