{"id":30635,"date":"2024-11-25T17:41:56","date_gmt":"2024-11-25T09:41:56","guid":{"rendered":"https:\/\/fwq.ai\/blog\/30635\/"},"modified":"2024-11-25T17:41:56","modified_gmt":"2024-11-25T09:41:56","slug":"phpcms%e6%97%a0%e6%b3%95%e6%b7%bb%e5%8a%a0%e6%a0%8f%e7%9b%ae%e6%80%8e%e4%b9%88%e5%8a%9e","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/30635\/","title":{"rendered":"phpcms\u65e0\u6cd5\u6dfb\u52a0\u680f\u76ee\u600e\u4e48\u529e"},"content":{"rendered":"<p style=\"text-align: center\"><strong><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5e04234cf1aac545.jpg\" class=\"aligncenter\" title=\"phpcms\u65e0\u6cd5\u6dfb\u52a0\u680f\u76ee\u600e\u4e48\u529e\u63d2\u56fe\" alt=\"phpcms\u65e0\u6cd5\u6dfb\u52a0\u680f\u76ee\u600e\u4e48\u529e\u63d2\u56fe\" \/><\/strong><\/p>\n<p><strong>\u65e0\u6cd5\u6dfb\u52a0\u680f\u76ee\u600e\u4e48\u529e\uff1f<\/strong><\/p>\n<p><strong>\u89e3\u51b3PHPCMS\u6dfb\u52a0\u680f\u76ee\u65f6\u62a5\u9519<\/strong><\/p>\n<pre>MYSQL&nbsp;error:&nbsp;Got&nbsp;a&nbsp;packet&nbsp;bigger&nbsp;than&nbsp;\u2018max_allowed_packet\u2019&nbsp;bytes<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5728\u4f7f\u7528 longtext \u7c7b\u578b\u6267\u884c\u6570\u636e\u5f55\u5165\u65f6\uff0c\u6709\u65f6\u4f1a\u629b\u51fa\u8fd9\u4e2a\u5f02\u5e38\uff0c<\/p>\n<p>\u4ece\u5b57\u9762\u7406\u89e3\u5c31\u662f\u5f53\u524d\u5305\u5927\u5c0f\u8d85\u8fc7 mysql \u7cfb\u7edf\u8bbe\u7f6e\u7684\u5305\u5927\u5c0f\u65e0\u6cd5\u6267\u884c\u64cd\u4f5c\u3002<\/p>\n<p>\u89e3\u91ca\u4e00\u4e0b\u5305\u5927\u5c0f\u8fd9\u4e2a\u4e1c\u897f\uff1a\u7b80\u5355\u6765\u8bf4\u5c31\u662fmysql\u628a\u5f53\u524d\u6267\u884c\u7684mysql\u8bed\u53e5\u770b\u4f5c\u662f\u4e00\u4e2a\u5305\uff0c<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p>\u800c\u5bf9\u8fd9\u4e2a\u5305\u5927\u5c0f\u7684\u9650\u5236\u5373\u662f\u5bf9\u5f53\u524dmysql\u8bed\u53e5\u957f\u5ea6\u7684\u9650\u5236\u3002<\/p>\n<p>\u89e3\u51b3\u529e\u6cd5\uff1a<\/p>\n<p>&nbsp;(1)Linux \u4e0b\uff1a<\/p>\n<p>\u8fdb\u5165\u670d\u52a1\u5668\u8def\u5f84 \/etc \u627e\u5230 my.cnf \u5728\u91cc\u9762\u7684 mysqld \u6bb5\u4e2d<\/p>\n<p> \u627e\u5230 max_allowed_packet = \u5927\u5c0f<\/p>\n<p>\u4fee\u6539\u5230\u9002\u5f53\u5927\u5c0f\u5e76\u4fdd\u5b58\uff0c\u7136\u540e\u91cd\u65b0\u542f\u52a8 mysql \u670d\u52a1\u5668\uff0c\u5373\u53ef\u3002\u5982\u679c\u6ca1\u6709\u8fd9\u884c\u5c31\u589e\u52a0\u8fd9\u884c\u3002<\/p>\n<p>(2)Windows\u4e0b\uff1a<\/p>\n<p>\u8fdb\u5165\u5230mysql\u5b89\u88c5\u8def\u5f84\u4e0b\uff0c\u627e\u5230 my.ini \u6587\u4ef6\uff0c\u5728[mysqld]\u90e8\u5206\uff08\u4e0d\u5728\u8fd9\u90e8\u5206\u6ca1\u7528\uff09\u6dfb\u52a0\u4e00\u53e5\uff1a<\/p>\n<p>set-variable=max_allowed_packet=\u5927\u5c0f\u3002\u4fdd\u5b58\u540e\u91cd\u65b0\u8d77\u52a8mysql\u670d\u52a1\u3002<\/p>\n<p>\u987a\u4fbf\u8bf4\u4e00\u4e0b\uff1a\u90a3\u4e2a\u5927\u5c0f\u7684\u8bbe\u7f6e\u5728 linux \u4e0b\u53ef\u4ee5\u76f4\u63a5\u5199 10M\u300120000K\u4e4b\u7c7b\u7684<\/p>\n<p>\u4f46\u662f\u5728windows\u4e0b\u5c31\u53ea\u80fd\u6362\u7b97\u6210byte.<\/p>\n<p>PHP\u4e2d\u6587\u7f51\uff0c\u5927\u91cf\u7684\u514d\u8d39\uff0c\u6b22\u8fce\u5728\u7ebf\u5b66\u4e60\uff01<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u65e0\u6cd5\u6dfb\u52a0\u680f\u76ee\u600e\u4e48\u529e\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u65e0\u6cd5\u6dfb\u52a0\u680f\u76ee\u600e\u4e48\u529e\uff1f \u89e3\u51b3PHPCMS\u6dfb\u52a0\u680f\u76ee\u65f6\u62a5\u9519 MYSQL&nbsp;error:&nbsp;Got&nbsp;a&nbsp;packet&nbsp;bigger&nbsp;than&nbsp;\u2018max_allowed_packet\u2019&nbsp;bytes \u767b\u5f55\u540e\u590d\u5236 \u5728\u4f7f\u7528 longtext \u7c7b\u578b\u6267\u884c\u6570\u636e\u5f55\u5165\u65f6\uff0c\u6709\u65f6\u4f1a\u629b\u51fa\u8fd9\u4e2a\u5f02\u5e38\uff0c \u4ece\u5b57\u9762\u7406\u89e3\u5c31\u662f\u5f53\u524d\u5305\u5927\u5c0f\u8d85\u8fc7 mysql \u7cfb\u7edf\u8bbe\u7f6e\u7684\u5305\u5927\u5c0f\u65e0\u6cd5\u6267\u884c\u64cd\u4f5c\u3002 \u89e3\u91ca\u4e00\u4e0b\u5305\u5927\u5c0f\u8fd9\u4e2a\u4e1c\u897f\uff1a\u7b80\u5355\u6765\u8bf4\u5c31\u662fmysql\u628a\u5f53\u524d\u6267\u884c\u7684mysql\u8bed\u53e5\u770b\u4f5c\u662f\u4e00\u4e2a\u5305\uff0c \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u800c\u5bf9\u8fd9\u4e2a\u5305\u5927\u5c0f\u7684\u9650\u5236\u5373\u662f\u5bf9\u5f53\u524dmysql\u8bed\u53e5\u957f\u5ea6\u7684\u9650\u5236\u3002 \u89e3\u51b3\u529e\u6cd5\uff1a &nbsp;(1)Linux \u4e0b\uff1a \u8fdb\u5165\u670d\u52a1\u5668\u8def\u5f84 \/etc \u627e\u5230 my.cnf \u5728\u91cc\u9762\u7684 mysqld \u6bb5\u4e2d \u627e\u5230 max_allowed_packet = \u5927\u5c0f \u4fee\u6539\u5230\u9002\u5f53\u5927\u5c0f\u5e76\u4fdd\u5b58\uff0c\u7136\u540e\u91cd\u65b0\u542f\u52a8 mysql \u670d\u52a1\u5668\uff0c\u5373\u53ef\u3002\u5982\u679c\u6ca1\u6709\u8fd9\u884c\u5c31\u589e\u52a0\u8fd9\u884c\u3002 (2)Windows\u4e0b\uff1a \u8fdb\u5165\u5230mysql\u5b89\u88c5\u8def\u5f84\u4e0b\uff0c\u627e\u5230 my.ini \u6587\u4ef6\uff0c\u5728[mysqld]\u90e8\u5206\uff08\u4e0d\u5728\u8fd9\u90e8\u5206\u6ca1\u7528\uff09\u6dfb\u52a0\u4e00\u53e5\uff1a set-variable=max_allowed_packet=\u5927\u5c0f\u3002\u4fdd\u5b58\u540e\u91cd\u65b0\u8d77\u52a8mysql\u670d\u52a1\u3002 \u987a\u4fbf\u8bf4\u4e00\u4e0b\uff1a\u90a3\u4e2a\u5927\u5c0f\u7684\u8bbe\u7f6e\u5728 linux \u4e0b\u53ef\u4ee5\u76f4\u63a5\u5199 10M\u300120000K\u4e4b\u7c7b\u7684 \u4f46\u662f\u5728windows\u4e0b\u5c31\u53ea\u80fd\u6362\u7b97\u6210byte. PHP\u4e2d\u6587\u7f51\uff0c\u5927\u91cf\u7684\u514d\u8d39\uff0c\u6b22\u8fce\u5728\u7ebf\u5b66\u4e60\uff01 \u4ee5\u4e0a\u5c31\u662f\u65e0\u6cd5\u6dfb\u52a0\u680f\u76ee\u600e\u4e48\u529e\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-30635","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=30635"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/30635\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=30635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=30635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=30635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}