折腾无极限
不曾长大

折腾WordPress碰到的一些问题

以下皆是在Nginx服务器下设置的。

部署SSL证书

使用TrustAsia的证书,开启SSL,按照说明修改.conf,重启Nginx报错,报错内容如下:

Stoping nginx... nginx: [emerg] invalid number of arguments in "ssl_certificate" directive in /usr/local/nginx/conf/vhost/www.yourdomain.com.conf:10
 failed. Use force-quit
Starting nginx... nginx (pid ***** *****) already running.

最后仔细看配置才发现ssl_certificate server.pem 及ssl_certificate_key server.key这2行最后都没有加“;”。

[hr]
Gmail SMTP插件

使用Gmail SMTP插件是为了通过gmail发邮件,从而避免泄露服务器ip以及邮件容易被误认为垃圾邮件的风险。
填好客户端id、客户端密钥等信息,点击Grant Permission(授权)时报错,报错内容如下:

Error: redirect_uri_mismatch

The redirect URI in the request, https://www.yourdomain.com/wp-admin/options-general.php?page=gmail-smtp-settings&action=oauth_grant, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/*****************

尝试数次都无效。

后来直接在https://console.developers.google.com“网页应用 的客户端 ID”的“已获授权的重定向 URI”文本框里输入https://www.yourdomain.com/wp-admin/options-general.php?page=gmail-smtp-settings&action=oauth_grant,保存。再在WordPress后台点击授权就成功了。

赞(0) 打赏
未经允许不得转载:子痕的博客 » 折腾WordPress碰到的一些问题

评论 3

  1. #-19

    折腾的过程很煎熬,过了却很充实

    品牌升级6年前 (2018-03-05)回复
  2. #-18

    Gmail SMTP 插件 看着还不错,目前在用 postfix 自建发送,以后有机会试试。

    老杨6年前 (2018-03-05)回复
    • 其实用sendmail就可以发邮件,但这样会暴露本机ip,发出的邮件也容易被误认为spam,所以还是用Gmail SMTP方便。

      子痕6年前 (2018-03-07)回复

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏