3

我一直在用头撞墙。我在 AppEngine 上运行 Wordpress 并且一切正常(遵循 GAE 安装说明),但我无法在帖子中插入图像。我已经安装了 GAE WP 插件并正确设置了云存储(我知道这是因为上传确实有效,当我转到 WP 左侧导航中的媒体 > 库时可以看到上传。

这是我在 wp-admin/async-upload.php 日志中的错误:

W 2013-09-28 12:05:02.529
PHP Notice:  Undefined variable: types in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 4385
W 2013-09-28 12:05:02.529
PHP Warning:  array_keys() expects parameter 1 to be array, null given in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 4385
W 2013-09-28 12:05:02.529
PHP Warning:  asort() expects parameter 1 to be array, null given in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 2231
W 2013-09-28 12:05:02.529
PHP Warning:  Invalid argument supplied for foreach() in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 2232
W 2013-09-28 12:05:02.529
PHP Notice:  Undefined variable: icon in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 4398

这是我在 wp-admin/admin-ajax.php 的日志中得到的内容:

W 2013-09-28 12:05:03.683
PHP Notice:  Undefined variable: types in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 4385
W 2013-09-28 12:05:03.683
PHP Warning:  array_keys() expects parameter 1 to be array, null given in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 4385
W 2013-09-28 12:05:03.683
PHP Warning:  asort() expects parameter 1 to be array, null given in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 2231
W 2013-09-28 12:05:03.683
PHP Warning:  Invalid argument supplied for foreach() in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 2232
W 2013-09-28 12:05:03.683
PHP Notice:  Undefined variable: icon in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 4398
W 2013-09-28 12:05:03.745
PHP Notice:  Undefined variable: types in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 4385
W 2013-09-28 12:05:03.745
PHP Warning:  array_keys() expects parameter 1 to be array, null given in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 4385
W 2013-09-28 12:05:03.745
PHP Warning:  asort() expects parameter 1 to be array, null given in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 2231
W 2013-09-28 12:05:03.745
PHP Warning:  Invalid argument supplied for foreach() in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 2232
W 2013-09-28 12:05:03.745
PHP Notice:  Undefined variable: icon in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 4398
W 2013-09-28 12:05:03.751
PHP Notice:  Undefined variable: types in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 4385
W 2013-09-28 12:05:03.751
PHP Warning:  array_keys() expects parameter 1 to be array, null given in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 4385
W 2013-09-28 12:05:03.751
PHP Warning:  asort() expects parameter 1 to be array, null given in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 2231
W 2013-09-28 12:05:03.751
PHP Warning:  Invalid argument supplied for foreach() in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 2232
W 2013-09-28 12:05:03.751
PHP Notice:  Undefined variable: icon in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 4398
W 2013-09-28 12:05:03.755
PHP Notice:  Undefined variable: types in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 4385
W 2013-09-28 12:05:03.755
PHP Warning:  array_keys() expects parameter 1 to be array, null given in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 4385
W 2013-09-28 12:05:03.756
PHP Warning:  asort() expects parameter 1 to be array, null given in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 2231
W 2013-09-28 12:05:03.756
PHP Warning:  Invalid argument supplied for foreach() in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 2232
W 2013-09-28 12:05:03.756
PHP Notice:  Undefined variable: icon in /base/data/home/apps/s~WPONGAE/wp.0000000000000000/wordpress/wp-includes/post.php on line 4398

我在这里想念什么?谢谢你的帮助。

4

2 回答 2

0

这不是最佳解决方案,但作为一种临时解决方法,我已经能够通过抑制 /includes/post.php 中的错误来解决问题。基本上,AJAX 调用在数据中遇到了一堆错误,并且不知道如何处理它,所以我只是停留error_reporting(0);在文件的顶部。

于 2013-09-28T21:14:22.830 回答
0

您还可以通过在 app.yaml 中的以下映射中添加“application_readable:true”来消除这些消息

- url: /(.*\.(ico|jpg|png|gif))$
  static_files: wordpress/\1
  upload: wordpress/.*\.(ico|jpg|png|gif)$
于 2014-07-12T00:52:52.413 回答