{"id":9088,"date":"2023-06-05T13:06:17","date_gmt":"2023-06-05T05:06:17","guid":{"rendered":"http:\/\/pro369.com\/blog\/?p=150"},"modified":"2023-06-05T13:06:17","modified_gmt":"2023-06-05T05:06:17","slug":"%e6%9e%b6%e8%a8%ad-wordpress%e5%87%ba%e7%8f%be-cannot-modify-header-information%e7%9a%84%e8%a7%a3%e6%b1%ba%e6%96%b9%e6%b3%95-2","status":"publish","type":"post","link":"https:\/\/por.tw\/blog\/2023\/06\/05\/%e6%9e%b6%e8%a8%ad-wordpress%e5%87%ba%e7%8f%be-cannot-modify-header-information%e7%9a%84%e8%a7%a3%e6%b1%ba%e6%96%b9%e6%b3%95-2\/","title":{"rendered":"\u67b6\u8a2d WordPress\u51fa\u73fe Cannot modify header information\u7684\u89e3\u6c7a\u65b9\u6cd5"},"content":{"rendered":"<p><strong><span style=\"font-size: 16px;\">\u5f88\u591a\u4eba\u5728\u67b6\u8a2dWordPress\u6642\uff0c\u5e38\u5e38\u63db\u7528\u65b0\u4f48\u666f\u6216\u662f\u4e00\u958b\u59cb\u5b89\u88dd\u6642\u5e38\u5e38\u6703\u78b0\u5230\u4e00\u500b\u932f\u8aa4\u8a0a\u606f<br \/>\n<span style=\"color: #ff0000;\">\u300cCannot modify header information \u2013 headers already sent by\u300d<\/span><br \/>\n\u901a\u5e38\u9047\u5230\u554f\u984c\u5225\u64d4\u5fc3\uff0cGoogle\u4e00\u4e0b\u6703\u6709\u5f88\u591a\u7b54\u6848\u7684\uff0c\u9019\u554f\u984c\u5176\u5be6\u767c\u751f\u518d\u8f49\u5411\u6642\uff0c\u7de9\u885d\u5340\u51fa\u4e86\u4e9b\u554f\u984c\uff0c\u53ea\u8981\u958b\u555f\u4e00\u4e0b\u7cfb\u7d71\u8a2d\u5b9a\u8abf\u6574\u4e00\u4e0b\uff0c\u5c31\u53ef\u4ee5\u89e3\u6c7a\u9019\u500b\u554f\u984c\u4e86\u3002<\/span><\/strong><\/p>\n<p><strong><span style=\"font-size: 16px;\">\u901a\u5e38\u6703\u51fa\u73fe\u5728\u7db2\u9801\u8f49\u5411\u6642\uff0c\u63a1\u7528\u300cheader\u300d\u51fd\u5f0f\uff0c\u624d\u9020\u6210\u9019\u500b\u7de9\u885d\u5340\u7684\u932f\u8aa4\u8a0a\u606f\u3002<\/span><\/strong><\/p>\n<p><strong><span style=\"font-size: 16px;\">Cannot modify header information\u7684\u89e3\u6c7a\u65b9\u6cd5<\/span><\/strong><\/p>\n<p><strong><span style=\"font-size: 16px;\">\u9019\u500b\u554f\u984c\u5168\u53e5\u8b66\u544a\u8a0a\u606f\u662f\uff1a<\/span><\/strong><\/p>\n<p><span style=\"color: #ff0000;\"><strong><span style=\"font-size: 16px;\">Warning: Cannot modify header information \u2013 headers already sent by<\/span><\/strong><\/span><\/p>\n<p><strong><span style=\"font-size: 16px;\">\u5176\u5be6\u89e3\u6c7a\u65b9\u6cd5\u5f88\u7c21\u55ae\uff0c\u53ea\u8981\u8abf\u6574\u4e00\u4e0bphp.ini\u5167\u7684\u8a2d\u5b9a\u503c\u5c31\u53ef\u4ee5\u6b63\u5e38\u4e86\uff0c\u63db\u53e5\u8a71\u8aaa\uff0c\u5c31\u662f\u7cfb\u7d71\u672c\u8eab\u6709\u500b\u8a2d\u5b9a\u503c\u9810\u8a2d\u662f\u672a\u958b\u555f\uff0c\u53ea\u8981\u6211\u5011\u5c07\u4ed6\u958b\u555f\u5c31\u53ef\u4ee5\u4e86\u3002<\/span><\/strong><\/p>\n<p><strong><span style=\"font-size: 16px;\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/por.tw\/blog\/wp-content\/uploads\/2014\/02\/8538586659.jpg\" width=\"630\" height=\"492\" \/><\/span><\/strong><\/p>\n<p><strong><span style=\"font-size: 16px;\">\u6240\u4ee5\u627e\u5230\u7cfb\u7d71\u8a2d\u5b9a\u6a94\u300cphp.ini\u300d\uff0c\u5efa\u8b70\u4f7f\u7528\u300cEMEdit\u6587\u5b57\u7de8\u8f2f\u8edf\u9ad4\u300d\u958b\u555f\uff0c<span style=\"color: #ff0000;\">\u627e\u5230\u300coutput_buffering\u300d\u4e26\u5c07\u4ed6\u5f8c\u9762\u7684\u503c\u8a2d\u5b9a\u70ba\u300cOn\u300d(\u555f\u52d5)<\/span>\uff0c\u7576\u7136\u4e5f\u53ef\u4ee5\u8a2d\u5b9a\u6210\u300c4096\u300d\u6216\u66f4\u9ad8\u7684\u6578\u503c(\u8a2d\u5b9a\u7de9\u885d\u5340\u5927\u5c0f)\uff0c\u7136\u5f8c\u5132\u5b58\u4e26\u91cd\u65b0\u555f\u52d5Apache\u5c31\u53ef\u4ee5\u4e86\u3002<\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"post-excerpt\"><p>\u5f88\u591a\u4eba\u5728\u67b6\u8a2dWordPress\u6642\uff0c\u5e38\u5e38\u63db\u7528\u65b0\u4f48\u666f\u6216\u662f\u4e00\u958b\u59cb\u5b89\u88dd\u6642\u5e38\u5e38\u6703\u78b0\u5230\u4e00\u500b\u932f\u8aa4\u8a0a\u606f \u300cCannot mod<\/p>\n<\/div>","protected":false},"author":1,"featured_media":548,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[91],"class_list":["post-9088","post","type-post","status-publish","format-standard","has-post-thumbnail","category-3","tag-91"],"_links":{"self":[{"href":"https:\/\/por.tw\/blog\/wp-json\/wp\/v2\/posts\/9088","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/por.tw\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/por.tw\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/por.tw\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/por.tw\/blog\/wp-json\/wp\/v2\/comments?post=9088"}],"version-history":[{"count":0,"href":"https:\/\/por.tw\/blog\/wp-json\/wp\/v2\/posts\/9088\/revisions"}],"wp:attachment":[{"href":"https:\/\/por.tw\/blog\/wp-json\/wp\/v2\/media?parent=9088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/por.tw\/blog\/wp-json\/wp\/v2\/categories?post=9088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/por.tw\/blog\/wp-json\/wp\/v2\/tags?post=9088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}