一、php配置项打开,一共3处要改:
~~~
文件位置:
D:\phpStudy\php\php-5.6.27-nts\php.ini
~~~
第一处:2个地方去掉前面的 ;
~~~
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
extension_dir = "./"
; On windows:
extension_dir = "ext"
~~~
第二处:1个地方去掉前面的 ;
~~~
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
~~~
第三处:1个地方去掉前面的 ;并在后面加上CA证书路径。
注意:因为SSL连接需要认证,所以继续下面的步骤之前,需要准备好CA证书(在phpstudy中建议把证书保存到D:\phpStudy\php\verify目录中,因为其它版本的PHP也要用到),可以从https://curl.haxx.se/docs/caextract.html处下载。
~~~
[openssl]
; The location of a Certificate Authority (CA) file on the local filesystem
; to use when verifying the identity of SSL/TLS peers. Most users should
; not specify a value for this directive as PHP will attempt to use the
; OS-managed cert stores in its absence. If specified, this value may still
; be overridden on a per-stream basis via the "cafile" SSL stream context
; option.
openssl.cafile=D:\phpStudy\php\verify\cacert.pem
~~~
二、php.ini配置完成保存,重启phpstudy。
![](https://box.kancloud.cn/364fb94442880da4fc7cd856e902715f_678x230.png)
没有报错了,说明问题解决。