此文章同步刊登於我的部落格
一、下載憑證
- 點選
cacert.pem
下載CA certificates extracted from Mozilla

- 將憑證放置到伺服器的主機上,例如
/etc/ssl/certs/cacert.pem
二、設定php.ini
- 開啟php.ini,並找到以下兩行
;openssl.cafile=
;openssl.capath= - 刪除最前面的分號取消註解,並將下載的憑證路徑設定到這兩行上後儲存
openssl.cafile=/etc/ssl/certs/cacert.pem
openssl.capath=/etc/ssl/certs/cacert.pem
三、重新啟動Web Server
- 重新啟動web server
# Apache
對於沒有systemd的Linux系統
systemctl httpd restart
# Nginx
systemctl nginx restart# Apache
service stop httpd
service start httpd
# Nginx
service stop nginx
service start nginx - 如果是使用php-fpm也要重新啟動
service stop php7-fpm
service start php7-fpm