macOS 10.11
开发桌面版本 2
PHP 5.6
尝试加载包含 Google 地图的 Drupal 8 模板页面。适用于生产和开发服务器,但不适用于本地。页面给出“网站遇到意外错误。请稍后再试。” 本地加载时出错,回溯跟踪显示以下信息:
错误:
GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in GuzzleHttp\Handler\CurlFactory::createRejection() (line 187 of vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php).
诊断:
array(8) { ["default_cert_file"]=> string(68) "/Users/acquia/csbworkdir/dmitrybezer/libopenssl/install/ssl/cert.pem" ["default_cert_file_env"]=> string(13) "SSL_CERT_FILE" ["default_cert_dir"]=> string(65) "/Users/acquia/csbworkdir/dmitrybezer/libopenssl/install/ssl/certs" ["default_cert_dir_env"]=> string(12) "SSL_CERT_DIR" ["default_private_dir"]=> string(67) "/Users/acquia/csbworkdir/dmitrybezer/libopenssl/install/ssl/private" ["default_default_cert_area"]=> string(59) "/Users/acquia/csbworkdir/dmitrybezer/libopenssl/install/ssl" ["ini_cafile"]=> string(47) "/Applications/DevDesktop/common/cert/cacert.pem" ["ini_capath"]=> string(0) "" }
回溯:
GuzzleHttp\Handler\CurlFactory::finishError(Object, Object, Object) (Line: 103)
GuzzleHttp\Handler\CurlFactory::finish(Object, Object, Object) (Line: 43)
GuzzleHttp\Handler\CurlHandler->__invoke(Object, Array) (Line: 28)
GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object, Array) (Line: 51)
GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}(Object, Array) (Line: 37)
GuzzleHttp\PrepareBodyMiddleware->__invoke(Object, Array) (Line: 30)
GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object, Array) (Line: 70)
GuzzleHttp\RedirectMiddleware->__invoke(Object, Array) (Line: 57)
GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object, Array) (Line: 67)
GuzzleHttp\HandlerStack->__invoke(Object, Array) (Line: 277)
GuzzleHttp\Client->transfer(Object, Array) (Line: 125)
GuzzleHttp\Client->requestAsync('get', 'https://maps.googleapis.com/maps/api/geocode/json', Array) (Line: 131)
GuzzleHttp\Client->request('get', 'https://maps.googleapis.com/maps/api/geocode/json', Array) (Line: 89)
GuzzleHttp\Client->__call('get', Array) (Line: 273)
GuzzleHttp\Client->get('https://maps.googleapis.com/maps/api/geocode/json', Array) (Line: 273)
似乎正在使用“default_cert_file”(并且在本地不存在)并且确实存在的文件“/Applications/DevDesktop/common/cert/cacert.pem”不是。默认值是从 Dev Desktop 中的 PHP 构建硬连线的。我不确定 Guzzle 是否不会费心尝试从可用列表中找到其他选项,或者我是否还有其他问题。
有没有办法从 php.ini 覆盖“default_cert_file”...??还是有更好的解决方案?
我什至创建了 default_cert_file 正在寻找的位置,只是为了看看这是否能解决它,但它没有。