dongshu9458 2013-10-02 07:47
浏览 72
已采纳

在Google App Engine上运行Wordpress时出现数据库错误

I'm trying to run Wordpress on my PHP runtime whitelisted Google App Engine application. I created a module named "wordpress" and installed Wordpress 3.6.1 (in Dutch) as per the instructions found in this article. (Update: I tried Wordpress 2.5.1 English, 2.6 Dutch and 2.6.1 Dutch. I got the same error messages with all versions.)

It worked without a problem in my local development environment but not in production on Google App Engine. When I go to http://www.mydomain.com/wordpress/, it redirects to http://www.mydomain.com/wordpress/wp-admin/install.php. In the App Engine logs of the Wordpress module I get these messages ("databasefout" means "database error"):

E 2013-10-02 09:23:33.030
WordPress databasefout Table 'wordpress_db.wp_options' doesn't exist bij query SELECT option_value FROM wp_options WHERE option_name = 'siteurl' LIMIT 1 gemaakt door require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), wp_plugin_directory_constants, get_option
...
E 2013-10-02 09:23:33.506
WordPress databasefout Table 'wordpress_db.wp_options' doesn't exist bij query SELECT option_value FROM wp_options WHERE option_name = 'cron' LIMIT 1 gemaakt door require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, wp_schedule_update_checks, wp_next_scheduled, _get_cron_array, get_option
E 2013-10-02 09:23:33.511
WordPress databasefout Table 'wordpress_db.wp_options' doesn't exist bij query INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('cron', 'a:2:{i:1380698613;a:1:{s:16:\"wp_version_check\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}}s:7:\"version\";i:2;}', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`) gemaakt door require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, wp_schedule_update_checks, wp_schedule_event, _set_cron_array, update_option, add_option
E 2013-10-02 09:23:33.513
WordPress databasefout Table 'wordpress_db.wp_options' doesn't exist bij query UPDATE `wp_options` SET `option_value` = 'a:2:{i:1380698613;a:2:{s:16:\"wp_version_check\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}s:17:\"wp_update_plugins\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}}s:7:\"version\";i:2;}' WHERE `option_name` = 'cron' gemaakt door require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, wp_schedule_update_checks, wp_schedule_event, _set_cron_array, update_option
E 2013-10-02 09:23:33.515
WordPress databasefout Table 'wordpress_db.wp_options' doesn't exist bij query UPDATE `wp_options` SET `option_value` = 'a:2:{i:1380698613;a:3:{s:16:\"wp_version_check\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}s:17:\"wp_update_plugins\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}s:16:\"wp_update_themes\";a:1:{s:32:\"40cd750bba9870f18aada2478b24840a\";a:3:{s:8:\"schedule\";s:10:\"twicedaily\";s:4:\"args\";a:0:{}s:8:\"interval\";i:43200;}}}s:7:\"version\";i:2;}' WHERE `option_name` = 'cron' gemaakt door require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, wp_schedule_update_checks, wp_schedule_event, _set_cron_array, update_option
E 2013-10-02 09:23:33.516
WordPress databasefout Table 'wordpress_db.wp_options' doesn't exist bij query SELECT option_value FROM wp_options WHERE option_name = 'theme_switched' LIMIT 1 gemaakt door require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, check_theme_switched, get_option
E 2013-10-02 09:23:33.518
WordPress databasefout Table 'wordpress_db.wp_options' doesn't exist bij query SELECT option_value FROM wp_options WHERE option_name = 'rewrite_rules' LIMIT 1 gemaakt door require('wp-blog-header.php'), wp, WP->main, WP->parse_request, WP_Rewrite->wp_rewrite_rules, get_option
...
E 2013-10-02 09:23:33.530
WordPress databasefout Table 'wordpress_db.wp_options' doesn't exist bij query SELECT option_value FROM wp_options WHERE option_name = 'sticky_posts' LIMIT 1 gemaakt door require('wp-blog-header.php'), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts, get_option

My database wordpress_db on my Google Cloud SQL instance is still empty (no tables). My MySQL user has the following privileges:

GRANTEE
TABLE_CATALOG
TABLE_SCHEMA
PRIVILEGE_TYPE
IS_GRANTABLE
'wp_user'@'localhost'
def
wordpress_db
SELECT
NO
'wp_user'@'localhost'
def
wordpress_db
INSERT
NO
'wp_user'@'localhost'
def
wordpress_db
UPDATE
NO
'wp_user'@'localhost'
def
wordpress_db
DELETE
NO
'wp_user'@'localhost'
def
wordpress_db
CREATE
NO
'wp_user'@'localhost'
def
wordpress_db
DROP
NO
'wp_user'@'localhost'
def
wordpress_db
REFERENCES
NO
'wp_user'@'localhost'
def
wordpress_db
INDEX
NO
'wp_user'@'localhost'
def
wordpress_db
ALTER
NO
'wp_user'@'localhost'
def
wordpress_db
CREATE TEMPORARY TABLES
NO
'wp_user'@'localhost'
def
wordpress_db
LOCK TABLES
NO
'wp_user'@'localhost'
def
wordpress_db
EXECUTE
NO
'wp_user'@'localhost'
def
wordpress_db
CREATE VIEW
NO
'wp_user'@'localhost'
def
wordpress_db
SHOW VIEW
NO
'wp_user'@'localhost'
def
wordpress_db
CREATE ROUTINE
NO
'wp_user'@'localhost'
def
wordpress_db
ALTER ROUTINE
NO
'wp_user'@'localhost'
def
wordpress_db
EVENT
NO
'wp_user'@'localhost'
def
wordpress_db
TRIGGER
NO

What could be the problem? It seems to me Wordpress is trying to access the table wordpress_db.wp_options before creating it.

Update: if I create the database tables manually on the Google Cloud SQL instance, and then go to http://www.mydomain.com/wordpress/ I get the message:

wordpress error establishing a database connection

  • 写回答

2条回答 默认 最新

  • douxianji6104 2013-10-07 07:04
    关注

    Apparently the Wordpress installation only succeeds if you access it via the URL wordpress-dot-myapp.appspot.com. The installation doesn't succeed if you access it via www.mydomain.com/wordpress. Please note that in my case, Wordpress was installed as a module of an existing Python app.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化