我有两个不同的多站点:
在这两个站点上,都有5个子站点。
它们托管在同一台服务器上(我已经使用VirtualMin安装了该服务器)。所有10个子网站都有相同的父主题,不同的子主题也有细微的变化。
我已经把网站转换成古腾堡了,但是每当我上传一张图片,我就会得到这样的错误:
The response is not a valid JSON response.
..。在这里看到:

在错误日志中,我得到了以下错误:
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: PHP Fatal error: Uncaught Error: Call to undefined function upload_is_user_over_quota() in /PATH/TO/FOLDER/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php:808, referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit下面是整个堆栈跟踪:
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: PHP Fatal error: Uncaught Error: Call to undefined function upload_is_user_over_quota() in /PATH/TO/FOLDER/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php:808, referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: Stack trace:, referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: #0 /PATH/TO/FOLDER/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php(734): WP_REST_Attachments_Controller->check_upload_size(Array), referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: #1 /PATH/TO/FOLDER/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php(108): WP_REST_Attachments_Controller->upload_from_file(Array, Array), referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: #2 /PATH/TO/FOLDER/wp-includes/rest-api/class-wp-rest-server.php(936): WP_REST_Attachments_Controller->create_item(Object(WP_REST_Request)), referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: #3 /PATH/TO/FOLDER/wp-includes/rest-api/class-wp-rest-server.php(321): WP_REST_Server->dispatch(Object(WP_REST_Request)), referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: #4 /PATH/TO/FOLDER/wp-includes/rest-api.php(266): WP_REST_Server->serve_request('/wp/v2/media'), referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit
[DATESTAMP] [fcgid:warn] [pid 12345:tid 123456789012345] [client CLIENT_IP:55472] mod_fcgid: stderr: #5 /PATH/TO/FOLDER/wp-inclu in /PATH/TO/FOLDER/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php on line 808, referer: http://EXAMPLE.ORG/wp-admin/post.php?post=30&action=edit有人知道解决办法或解决办法吗?
发布于 2018-08-30 10:31:57
在挖掘过程中,这似乎是一个bug,在4.9.8中添加了WordPress。这个补丁似乎在Multisite上通过REST上传了中断的附件,因为它使用了一个来自未加载REST请求的文件中的函数。
我已经报告了窃听器这里。
一个快速而肮脏的解决方法是将其添加到主题的functions.php文件中,或者是一个简单的插件:
if ( ! function_exists( 'upload_is_user_over_quota' ) ) {
function upload_is_user_over_quota( $echo ) {
return false;
}
}这个函数不会做它应该做的事情,但是它将防止致命的错误发生。
https://wordpress.stackexchange.com/questions/312859
复制相似问题