今日、ある外国貿易向けサイトにテーマをインストールしている際、デモデータのインポートが完了した後、サイトのフロントエンドで画像が表示される位置でエラーが発生しました。内容は以下の通りです:
Warning: getimagesize(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /www/wwwroot/*/wp-content/themes/*/framework/class-image.php on line 120 Warning: getimagesize(): Failed to enable crypto in /www/wwwroot/*/wp-content/themes/*/framework/class-image.php on line 120 Warning: getimagesize(https://*/wp-content/uploads/2021/02/video-opacity-tiny.png): failed to open stream: operation failed in /www/wwwroot/*/wp-content/themes/*/framework/class-image.php on line 120
この問題の原因は証明書にあります。解決策は以下の通りです:
1. cert証明書をサーバーの任意の場所にダウンロードします。URL:https://curl.haxx.se/ca/cacert.pem
2. php.ini 設定ファイル内の openssl.cafile= を openssl.cafile=サーバーディレクトリ/cacert.pem に変更します。
3. 再度実行してください。
————————————————
方法の出典:https://blog.csdn.net/default7/article/details/77008973