0

Google Apps for Work를 사용 중이며 PHP의 드라이브 API에 액세스 할 수있는 서비스 계정이 있습니다.로컬 서비스의 Google 서비스 계정

내가 지금 가지고있는 코드는 : 나는 외부에서 호스팅 내 아파치 서버에이 업로드 될 때

$client = new Google_Client(); 
$client->setApplicationName('MyApp'); 
$key = file_get_contents("/path/to/secure/key"); 
$cred = new Google_Auth_AssertionCredentials(
     "[email protected]", 
     array('https://www.googleapis.com/auth/drive', 'https://spreadsheets.google.com/feeds'), 
     $key, 'keysecretgoeshere', 'http://oauth.net/grant_type/jwt/1.0/bearer', "[email protected]" 
    ); 
$client->setAssertionCredentials($cred); 

이 완벽하게 작동합니다. 이상한 점은 EasyPHP를 사용하여 로컬 서버에서 로컬 서버를 테스트하고 페이지에 액세스하자마자 "이 사이트에 연결할 수 없습니다. 연결이 재설정되었습니다"라는 오류가 발생한다는 것입니다.

내가 localhost에서 작동하지 않는 이유가 무엇인지 놓치고 있습니까? PHP 확장이 설치되지 않았거나 일부 cURL/openSSL 문제 일 수 있습니까?

답변

0

각 지점에서 코드를 중단 한 후 OpenSSL에서 문제가되었습니다. 해결책은 여기에서 찾아 낼 수있다 :

PHP openssl_sign DIES