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 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题