Google PHP API库需要openssl PHP扩展

时间:2015-10-21 12:29:00

标签: php api openssl

尝试使用xampp服务器在本地主机上登录Google。

给出错误

  

致命错误:未捕获的异常' Google_Exception'有消息' Google PHP API库需要openssl PHP扩展程序'在C:\ xampp \ htdocs \ test \ vendor \ Signer \ P12.php:38堆栈跟踪:#0 C:\ xampp \ htdocs \ test \ vendor \ Auth \ AssertionCredentials.php(130):Google_Signer_P12-> __ construct( ' 0 ?????? 0 ????? *?...',' notasecret')#1 C:\ xampp \ htdocs \ test \ vendor \ Auth \ AssertionCredentials.php(107):Google_Auth_AssertionCredentials-> makeSignedJwt(Array)#2 C:\ xampp \ htdocs \ test \ vendor \ Auth \ OAuth2.php(312):Google_Auth_AssertionCredentials-> generateAssertion()#3 C:\ xampp \ htdocs \ test \ vendor \ Auth \ OAuth2.php(239):Google_Auth_OAuth2-> refreshTokenWithAssertion()#4 C:\ xampp \ htdocs \ test \ vendor \ Auth \ OAuth2.php(75):Google_Auth_OAuth2-> sign(Object(Google_Http_Request))#5 C:\ xampp \ htdocs \ test \ vendor \ RpcHelper.php(69):Google_Auth_OAuth2-> authenticatedRequest(Object(Google_Http_Request))#6 C:\ xampp \ htdocs \ test \ vendor \ GitkitClient.php(337):Gitkit_RpcHelper-> getGitkitCerts()#7 C:\ xampp \ htdocs \ test \ vendor \ GitkitClient.php(124):Gitkit_Client-> ge在C:\ xampp \ htdocs \ test \供应商\ Signer \ P12.php o n line 38

2 个答案:

答案 0 :(得分:1)

您需要在php.ini中启用openssl扩展。变化:

;extension=php_openssl.dll

要:

extension=php_openssl.dll

正如@ tino.codes所解释的那样,在更改后重新启动apache。

答案 1 :(得分:0)

要在XAMPP中启用OpenSSL,您必须编辑php.ini并删除分号:

;extension=php_openssl.dll

保存php.ini后重新启动apache。