WordPress 突然不能解析 Latex

问题描述

wordpress 是通过安装wp-QuickLatex这个插件来实现解析Latex 的,结果突然之间不能渲染各公式了,报警提示:

*** QuickLaTeX cannot compile formula:
S_1

*** Error message:
Cannot connect to QuickLaTeX server: cURL error 60: SSL certificate problem: certificate has expired
Please make sure your server/PHP settings allow HTTP requests to external resources ("allow_url_fopen", etc.)
These links might help in finding solution:
http://wordpress.org/extend/plugins/core-control/
http://wordpress.org/support/topic/an-unexpected-http-error-occurred-during-the-api-request-on-wordpress-3?replies=37

提示看起来是和cURL以及SSL有关,联想到最近更新了Let's Encrypt SSL 证书,有没有可能是这个问题呢。Google一阵子之后终于在wordpress的官方网站找到说明和解决方案

链接如下:
https://wordpress.org/support/topic/curl-error-60-ssl-certificate-problem-certificate-has-expired-11/#post-14930556

https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/

解决方案

  • Step -1
    由于此网站通过宝塔面板进行管理,找到php.ini的位置在
    /www/server/php/73/etc/目录下,其中73是因为安装的版本为php7.3,根据实际采用的版本来选择
    找到证书位置
    /xx/www.cryogeny.cn/wp-includes/certificates/ca-bundle.crt
    修改证书信息,删除 DST 段证书
    一开始还保留了DST ROOT CA X3 这一行,结果不行, 也就是需要连着这一行一起删除,整个证书段都需要删除掉。

  • Step -2
    于是又到 https://curl.se/ca下载了 cacert.pem,上传到/etc/pki/ca-trust/source/anchors/ 并改名为 ca-bundle.pem 感觉这一步的必要性不高,下一步的命令行应当会自动更新才对。

  • Step -3
    同时命令行更新证书

    yum list updates
    #如果没有ca-certificates 就安装,否则update这个package
    yum install ca-certificates
    yum update -y ca-certificates
    update-ca-trust

发表回复