我今天早些時候嘗試在Google App Engine下設置WordPress(按照此處的說明:https://developers.google.com/appengine/articles/wordpress)。在GAE + Cloud下運行WordPress時遇到問題SQL
它在本地運行良好,但是當我推到遠程時,我得到一個數據庫錯誤(可見於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正顯示出 「狀態可運行」 的開發者控制檯>雲端SQL。
我之前做過這件事,它工作,所以我不知道我在這裏錯過了什麼。我認爲這可能是因爲我使用WP 3.8.1。但回滾到3.5.1和同樣的事情發生。
任何想法? frontiermediag被列爲fmwp ACL上的授權應用程序。
DB_USER&DB_PASSWORD的設置是什麼?它們是否與你的CloudSQL中的設置相匹配? – Mars