简体   繁体   English

更新失败。 错误消息:响应不是有效的 JSON 响应

[英]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.

相关问题 WORDPRESS 更新失败。 错误信息。 响应不是有效的 JSON 响应 - WORDPRESS Updating failed. Error message. The response is not a valid JSON response 发布或上传失败。 错误消息:“响应不是有效的 JSON 响应” - Publishing or uploading failed. Error message: "The response is not a valid JSON response" WP - 更新失败。 响应不是有效的 JSON 响应 + 数据库中缺少该表 - WP - Update failed. The response is not a valid JSON response + the table is missing from the database 更新失败。 使用 WordPress 版本传递的无效 JSON 正文:5.5.1 - Updating Failed. Invalid JSON body passed with WordPress Version: 5.5.1 Wordpress“保存草稿”失败:“响应不是有效的 JSON 响应” - Wordpress “Save Draft” fails: “the response is not a valid JSON response” QBWC1012:由于以下错误消息,身份验证失败。 请求失败,响应为空 - QBWC1012: Authentication failed due to following error message. The request failed with an empty response 如何在JSON响应中捕获错误? - How to catch error in JSON response? wordpress 添加新页面或更新原因 由于简单的插件,响应不是有效的 JSON 响应 - wordpress add a new page or update cause The response is not a valid JSON response because of simple plugin Ionic 3推送通知错误“ statusText”:“未知错误”,“名称”:“ HttpErrorResponse”,“消息”:“(未知URL)的Http故障响应 - Ionic 3 Push Notification Error “statusText”:“Unknown Error”,“name”:“HttpErrorResponse”,“message”:"Http failure response for (unknown url) 通过 URL 的 JSON 响应未显示 - JSON response through URL not displaying
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM