{"id":838,"date":"2025-05-14T22:13:50","date_gmt":"2025-05-14T14:13:50","guid":{"rendered":"https:\/\/virtualcardx.com\/?p=838"},"modified":"2026-01-04T13:28:06","modified_gmt":"2026-01-04T05:28:06","slug":"%e5%a6%82%e4%bd%95%e4%b8%bawordpress%e7%bd%91%e7%ab%99%e5%bc%80%e5%90%af%e8%b0%83%e8%af%95%e6%a8%a1%e5%bc%8f%e6%8e%92%e6%9f%a5%e9%94%99%e8%af%af","status":"publish","type":"post","link":"https:\/\/virtualcardx.com\/en\/2025\/05\/14\/\u5982\u4f55\u4e3awordpress\u7f51\u7ad9\u5f00\u542f\u8c03\u8bd5\u6a21\u5f0f\u6392\u67e5\u9519\u8bef\/","title":{"rendered":"How to enable debug mode for wordpress websites to troubleshoot errors"},"content":{"rendered":"<p>Today the media image editing function in my wordpress site suddenly had the problem of not being able to save the edited image, checking the console, and finding that the admin-ajax.php page reported a 500 error. To be safe, wordpress will disable the debug function by default, but there is no specific error description, the subsequent debug can not be carried out at all.<\/p>\n\n\n\n<p>To find the exact reason for the error, I logged into the server<\/p>\n\n\n\n<p>Open wp-config.php in the wordpress root directory.<br>locate<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define('WP_DEBUG', false).<\/code><\/pre>\n\n\n\n<p>modify to<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define('WP_DEBUG', true);\ndefine('WP_DEBUG_LOG', true);<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"90\" data-src=\"https:\/\/virtualcardx.com\/wp-content\/uploads\/2025\/05\/a-1024x90.jpg\" alt=\"\" class=\"wp-image-839 lazyload\" title=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/90;\"><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Enable debug mode in wordpress, the second sentence means that by enabling WP_DEBUG_LOG, users can save all errors in the debug.log file<\/p>\n\n\n\n<p>The debug.log file is in the \/wp-content\/ folder<\/p>\n\n\n\n<p>On the frontend media page, re-edit the image and save it<\/p>\n\n\n\n<p>Then look at the contents of the debug.log file<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"623\" data-src=\"https:\/\/virtualcardx.com\/wp-content\/uploads\/2025\/05\/wordpressdebug-scaled-e1747232149910-1024x623.jpg\" alt=\"\" class=\"wp-image-840 lazyload\" title=\"\" data-srcset=\"https:\/\/virtualcardx.com\/wp-content\/uploads\/2025\/05\/wordpressdebug-scaled-e1747232149910-1024x623.jpg 1024w, https:\/\/virtualcardx.com\/wp-content\/uploads\/2025\/05\/wordpressdebug-scaled-e1747232149910-300x183.jpg 300w, https:\/\/virtualcardx.com\/wp-content\/uploads\/2025\/05\/wordpressdebug-scaled-e1747232149910-768x467.jpg 768w, https:\/\/virtualcardx.com\/wp-content\/uploads\/2025\/05\/wordpressdebug-scaled-e1747232149910-1536x935.jpg 1536w, https:\/\/virtualcardx.com\/wp-content\/uploads\/2025\/05\/wordpressdebug-scaled-e1747232149910-18x12.jpg 18w, https:\/\/virtualcardx.com\/wp-content\/uploads\/2025\/05\/wordpressdebug-scaled-e1747232149910.jpg 1766w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/623;\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Here you can see that it is the aliyun-oss plugin incompatibility with the new version of wordpress that is causing the problem<\/p>\n\n\n\n<p>Uninstalled the plugin, problem solved<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"74\" data-src=\"https:\/\/virtualcardx.com\/wp-content\/uploads\/2025\/05\/aliyunoss-scaled-e1747232174509-1024x74.jpg\" alt=\"\" class=\"wp-image-841 lazyload\" title=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/74;\"><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Finally, don't forget to turn off debug mode<\/p>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Today the media graphic in my wordpress site ... <\/p>\n<p class=\"read-more-container\"><a title=\"How to enable debug mode for wordpress websites to troubleshoot errors\" class=\"read-more button\" href=\"https:\/\/virtualcardx.com\/en\/2025\/05\/14\/\u5982\u4f55\u4e3awordpress\u7f51\u7ad9\u5f00\u542f\u8c03\u8bd5\u6a21\u5f0f\u6392\u67e5\u9519\u8bef\/#more-838\" aria-label=\"Read more about How to enable debug mode for wordpress website to troubleshoot errors\">Read more<\/a><\/p>","protected":false},"author":1,"featured_media":840,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[],"class_list":["post-838","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/virtualcardx.com\/en\/wp-json\/wp\/v2\/posts\/838","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/virtualcardx.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/virtualcardx.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/virtualcardx.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/virtualcardx.com\/en\/wp-json\/wp\/v2\/comments?post=838"}],"version-history":[{"count":0,"href":"https:\/\/virtualcardx.com\/en\/wp-json\/wp\/v2\/posts\/838\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/virtualcardx.com\/en\/wp-json\/wp\/v2\/media\/840"}],"wp:attachment":[{"href":"https:\/\/virtualcardx.com\/en\/wp-json\/wp\/v2\/media?parent=838"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/virtualcardx.com\/en\/wp-json\/wp\/v2\/categories?post=838"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/virtualcardx.com\/en\/wp-json\/wp\/v2\/tags?post=838"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}