【发布时间】:2016-10-20 04:18:15
【问题描述】:
我今晚早些时候尝试在 Google App Engine 下设置 WordPress(按照此处的说明操作:https://developers.google.com/appengine/articles/wordpress)。
它在本地运行良好,但是当我推送到远程时出现数据库错误(在https://wp-dot-frontiermediag.appspot.com/ 可见)。如果我们抛出 /wp_admin/install.php 你会得到:
This either means that the username and password information in your
wp-config.php file is incorrect or we can't contact the database server
at :/cloudsql/frontiermediag:fmwp. This could mean your host's database
server is down.
这是 wp-config 中的相关代码:
/** MySQL hostname */
if(isset($_SERVER['SERVER_SOFTWARE']) && strpos($_SERVER['SERVER_SOFTWARE'],'Google App Engine') !== false) {
define('DB_HOST', ':/cloudsql/frontiermediag:fmwp');
}else{
define('DB_HOST', 'localhost');
}
frontiermediag:fmwp 在 Developers Console > Cloud SQL 中显示“Status Runnable”。
我以前做过一次,它工作,所以我不确定我在这里错过了什么。我认为这可能是因为我使用的是 WP 3.8.1。但回滚到 3.5.1 并且发生了同样的事情。
有什么想法吗? frontiermediag 在 :fmwp ACL 上被列为授权应用程序。
【问题讨论】:
-
您对 DB_USER 和 DB_PASSWORD 的设置是什么?它们是否与您的 CloudSQL 中的设置相匹配?
标签: google-app-engine google-cloud-sql