[英]Updating failed. Error message: The response is not a valid JSON response
当我想将特色图片添加到我的 wordpress 帖子“更新失败。错误消息:响应不是有效的 JSON 响应”时出现此错误。
In my case it was due to a web server configuration (Apache2):就我而言,这是由于Web 服务器配置(Apache2):
AllowOverride None
Changed it to :将其更改为:
AllowOverride All
in在
/etc/apache2/apache2.conf
I had the same "not a valid JSON response" error when trying to publish my content.尝试发布我的内容时,我遇到了相同的“不是有效的 JSON 响应”错误。 WordPress seems to do a JSON post when publishing a new post/page so I checked the network tab in my Developer Tools. WordPress 在发布新帖子/页面时似乎会发布 JSON 帖子,因此我检查了开发人员工具中的网络选项卡。 If you check the "response" tab for this JSON call you might see some more details about this invalid JSON response.如果您检查此 JSON 调用的“响应”选项卡,您可能会看到有关此无效 JSON 响应的更多详细信息。
In my case (yours might be different) some deprecated debug message was outputted before the actual JSON data and messed up the response.在我的情况下(你的可能不同)在实际 JSON 数据之前输出了一些不推荐使用的调试消息并弄乱了响应。 After fixing the deprecated message publishing worked again.修复已弃用的消息发布后再次工作。
If you are trying this on your local or production wordpress install you may likely get this error as your .htaccess file is not writeable for security reasons.如果您在本地或生产 wordpress 安装上尝试此操作,您可能会收到此错误,因为出于安全原因,您的 .htaccess 文件不可写。
Error you will see in wordpress admin interface under permalink setting after you change from plain to any mode:从普通模式更改为任何模式后,您将在永久链接设置下的 wordpress 管理界面中看到错误:
If your .htaccess file was writable, we could do this automatically, but it isn't so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.
Make sure your .htaccess file is writeable whenever you change your permalink setting from PLAIN
mode to anyother mode like POST-NAME
每当您将永久链接设置从PLAIN
模式更改为任何其他模式(如POST-NAME
时,请确保您的 .htaccess 文件是可写的
For me this error was shown in the backend editor because of a line of text in another file which echoed that line of text on each response.对我而言,此错误显示在后端编辑器中,因为另一个文件中的一行文本在每个响应中都与该行文本相呼应。 Incl.包括when WordPress internally made its own request expecting a JSON response.当 WordPress 内部发出自己的请求,期望得到 JSON 响应时。 Once i removed that line issue disappeared.一旦我删除了该行问题就消失了。
I got the same error:我得到了同样的错误:
Updating failed.更新失败。 Error message: The response is not a valid JSON response错误消息:响应不是有效的 JSON 响应
after deactivating WordPress plugin Gutenberg.停用 WordPress 插件 Gutenberg 后。 I tried to reactivate it but the error still exists.我尝试重新激活它,但错误仍然存在。
The solution to my error was installing the "Classic Editor" plugin.我的错误的解决方案是安装“经典编辑器”插件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.