{"id":34253,"date":"2024-11-25T12:59:07","date_gmt":"2024-11-25T04:59:07","guid":{"rendered":"https:\/\/fwq.ai\/blog\/34253\/"},"modified":"2024-11-25T12:59:07","modified_gmt":"2024-11-25T04:59:07","slug":"phpcms%e4%b8%8a%e4%bc%a0%e5%9b%be%e7%89%87%e9%80%89%e6%8b%a9%e6%96%87%e4%bb%b6%e6%97%a0%e5%9c%b0%e5%9d%80%e6%80%8e%e4%b9%88%e5%8a%9e","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/34253\/","title":{"rendered":"phpcms\u4e0a\u4f20\u56fe\u7247\u9009\u62e9\u6587\u4ef6\u65e0\u5730\u5740\u600e\u4e48\u529e"},"content":{"rendered":"<blockquote><p>\n  phpcms\u56fe\u7247\u4e0a\u4f20\u9009\u62e9\u6587\u4ef6\u540e\u6ca1\u6709\u5730\u5740\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5\uff1a\u68c0\u67e5\u4e0a\u4f20\u6587\u4ef6\u7684\u7c7b\u578b\u548c\u5927\u5c0f\u662f\u5426\u7b26\u5408\u8981\u6c42\u3002\u68c0\u67e5\u670d\u52a1\u5668\u914d\u7f6e\u662f\u5426\u6b63\u786e\uff0c\u786e\u4fdd\u542f\u7528gd\u5e93\u3002\u786e\u8ba4php.ini\u8bbe\u7f6e\u6b63\u786e\uff0c\u5f00\u542f\u6587\u4ef6\u4e0a\u4f20\u5e76\u8bbe\u7f6e\u6700\u5927\u4e0a\u4f20\u5c3a\u5bf8\u3002\u68c0\u67e5\u4e34\u65f6\u76ee\u5f55\u6743\u9650\u662f\u5426\u8db3\u591f\u3002\u6e05\u9664\u6d4f\u89c8\u5668\u7f13\u5b58\u3002\u5347\u7ea7phpcms\u81f3\u6700\u65b0\u7248\u672c\u3002\u5982\u4ee5\u4e0a\u65b9\u6cd5\u5747\u65e0\u6548\uff0c\u8bf7\u5bfb\u6c42\u6280\u672f\u652f\u6301\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202404\/21\/2024042100121379975.jpg\" class=\"aligncenter\" title=\"phpcms\u4e0a\u4f20\u56fe\u7247\u9009\u62e9\u6587\u4ef6\u65e0\u5730\u5740\u600e\u4e48\u529e\u63d2\u56fe\" alt=\"phpcms\u4e0a\u4f20\u56fe\u7247\u9009\u62e9\u6587\u4ef6\u65e0\u5730\u5740\u600e\u4e48\u529e\u63d2\u56fe\" \/><\/p>\n<p><strong>\u4e0a\u4f20\u56fe\u7247\u9009\u62e9\u6587\u4ef6\u65f6\u65e0\u5730\u5740\u95ee\u9898\u89e3\u51b3\u65b9\u6cd5<\/strong><\/p>\n<p>\u5f53\u5728 phpcms \u7f51\u7ad9\u4e2d\u4e0a\u4f20\u56fe\u7247\u65f6\uff0c\u5982\u679c\u9047\u5230\u9009\u62e9\u6587\u4ef6\u540e\u6ca1\u6709\u663e\u793a\u56fe\u7247\u5730\u5740\u7684\u60c5\u51b5\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4ee5\u4e0b\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<p><strong>1. \u68c0\u67e5\u6587\u4ef6\u7c7b\u578b<\/strong><\/p>\n<p>\u786e\u8ba4\u6240\u4e0a\u4f20\u7684\u6587\u4ef6\u662f\u5426\u662f\u5141\u8bb8\u7684\u56fe\u7247\u7c7b\u578b\u3002phpcms \u9ed8\u8ba4\u652f\u6301\u7684\u56fe\u7247\u7c7b\u578b\u4e3a\uff1ajpg\u3001jpeg\u3001png\u3001bmp\u3002<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p><strong>2. \u68c0\u67e5\u6587\u4ef6\u5927\u5c0f<\/strong><\/p>\n<p>\u786e\u4fdd\u4e0a\u4f20\u7684\u56fe\u7247\u6587\u4ef6\u5927\u5c0f\u5c0f\u4e8e phpcms \u8bbe\u7f6e\u7684\u6700\u5927\u4e0a\u4f20\u9650\u5236\u3002\u53ef\u4ee5\u5728 phpcms \u540e\u53f0\u7684\u201c\u7cfb\u7edf\u201d-&gt;\u201c\u9644\u4ef6\u8bbe\u7f6e\u201d\u4e2d\u67e5\u770b\u548c\u4fee\u6539\u8be5\u9650\u5236\u3002<\/p>\n<p><strong>3. \u68c0\u67e5\u670d\u52a1\u5668\u914d\u7f6e<\/strong><\/p>\n<p>\u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u6b63\u786e\u914d\u7f6e\u4e86 PHP GD \u5e93\uff0c\u8be5\u5e93\u7528\u4e8e\u5904\u7406\u56fe\u50cf\u3002\u5982\u679c\u672a\u6b63\u786e\u914d\u7f6e\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u56fe\u7247\u65e0\u6cd5\u4e0a\u4f20\u6216\u663e\u793a\u3002<\/p>\n<p><strong>4. \u68c0\u67e5 php.ini \u8bbe\u7f6e<\/strong><\/p>\n<p>\u786e\u4fdd php.ini \u6587\u4ef6\u4e2d\u8bbe\u7f6e\u4e86\u6b63\u786e\u7684 file_uploads \u9009\u9879\u4e3a On\uff0c\u5e76\u4e14 upload_max_filesize \u548c upload_tmp_dir \u9009\u9879\u8bbe\u7f6e\u6b63\u786e\u3002<\/p>\n<p><strong>5. \u542f\u7528 GD \u5e93<\/strong><\/p>\n<p>\u5728\u670d\u52a1\u5668\u4e2d\u542f\u7528 PHP GD \u5e93\uff0c\u53ef\u4ee5\u5728 php.ini \u6587\u4ef6\u4e2d\u627e\u5230\u5e76\u6253\u5f00 extension=gd \u6216 extension=gd2 \u884c\u3002<\/p>\n<p><strong>6. \u68c0\u67e5\u4e34\u65f6\u76ee\u5f55\u6743\u9650<\/strong><\/p>\n<p>\u786e\u4fdd php.ini \u6587\u4ef6\u4e2d\u8bbe\u7f6e\u7684 upload_tmp_dir \u4e34\u65f6\u76ee\u5f55\u5177\u6709\u8db3\u591f\u7684\u6743\u9650\uff0c\u4ee5\u4fbf\u5199\u5165\u6587\u4ef6\u3002<\/p>\n<p><strong>7. \u6e05\u9664\u6d4f\u89c8\u5668\u7f13\u5b58<\/strong><\/p>\n<p>\u6709\u65f6\uff0c\u6d4f\u89c8\u5668\u7f13\u5b58\u53ef\u80fd\u4f1a\u5bfc\u81f4\u95ee\u9898\u3002\u5c1d\u8bd5\u6e05\u9664\u6d4f\u89c8\u5668\u7684\u7f13\u5b58\u5e76\u91cd\u65b0\u52a0\u8f7d\u9875\u9762\u3002<\/p>\n<p><strong>8. \u5347\u7ea7 phpcms<\/strong><\/p>\n<p>\u786e\u4fdd\u4f7f\u7528\u7684\u662f phpcms \u7684\u6700\u65b0\u7248\u672c\u3002\u65b0\u7684\u7248\u672c\u53ef\u80fd\u5305\u542b\u4fee\u590d\u4e0a\u8ff0\u95ee\u9898\u7684\u66f4\u65b0\u3002<\/p>\n<p><strong>9. \u8054\u7cfb\u6280\u672f\u652f\u6301<\/strong><\/p>\n<p>\u5982\u679c\u4e0a\u8ff0\u65b9\u6cd5\u90fd\u4e0d\u80fd\u89e3\u51b3\u95ee\u9898\uff0c\u53ef\u4ee5\u8054\u7cfb phpcms \u6280\u672f\u652f\u6301\u56e2\u961f\u5bfb\u6c42\u5e2e\u52a9\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u4e0a\u4f20\u56fe\u7247\u9009\u62e9\u6587\u4ef6\u65e0\u5730\u5740\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>phpcms\u56fe\u7247\u4e0a\u4f20\u9009\u62e9\u6587\u4ef6\u540e\u6ca1\u6709\u5730\u5740\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5\uff1a\u68c0\u67e5\u4e0a\u4f20\u6587\u4ef6\u7684\u7c7b\u578b\u548c\u5927\u5c0f\u662f\u5426\u7b26\u5408\u8981\u6c42\u3002\u68c0\u67e5\u670d\u52a1\u5668\u914d\u7f6e\u662f\u5426\u6b63\u786e\uff0c\u786e\u4fdd\u542f\u7528gd\u5e93\u3002\u786e\u8ba4php.ini\u8bbe\u7f6e\u6b63\u786e\uff0c\u5f00\u542f\u6587\u4ef6\u4e0a\u4f20\u5e76\u8bbe\u7f6e\u6700\u5927\u4e0a\u4f20\u5c3a\u5bf8\u3002\u68c0\u67e5\u4e34\u65f6\u76ee\u5f55\u6743\u9650\u662f\u5426\u8db3\u591f\u3002\u6e05\u9664\u6d4f\u89c8\u5668\u7f13\u5b58\u3002\u5347\u7ea7phpcms\u81f3\u6700\u65b0\u7248\u672c\u3002\u5982\u4ee5\u4e0a\u65b9\u6cd5\u5747\u65e0\u6548\uff0c\u8bf7\u5bfb\u6c42\u6280\u672f\u652f\u6301\u3002 \u4e0a\u4f20\u56fe\u7247\u9009\u62e9\u6587\u4ef6\u65f6\u65e0\u5730\u5740\u95ee\u9898\u89e3\u51b3\u65b9\u6cd5 \u5f53\u5728 phpcms \u7f51\u7ad9\u4e2d\u4e0a\u4f20\u56fe\u7247\u65f6\uff0c\u5982\u679c\u9047\u5230\u9009\u62e9\u6587\u4ef6\u540e\u6ca1\u6709\u663e\u793a\u56fe\u7247\u5730\u5740\u7684\u60c5\u51b5\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4ee5\u4e0b\u89e3\u51b3\u65b9\u6cd5\uff1a 1. \u68c0\u67e5\u6587\u4ef6\u7c7b\u578b \u786e\u8ba4\u6240\u4e0a\u4f20\u7684\u6587\u4ef6\u662f\u5426\u662f\u5141\u8bb8\u7684\u56fe\u7247\u7c7b\u578b\u3002phpcms \u9ed8\u8ba4\u652f\u6301\u7684\u56fe\u7247\u7c7b\u578b\u4e3a\uff1ajpg\u3001jpeg\u3001png\u3001bmp\u3002 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b 2. \u68c0\u67e5\u6587\u4ef6\u5927\u5c0f \u786e\u4fdd\u4e0a\u4f20\u7684\u56fe\u7247\u6587\u4ef6\u5927\u5c0f\u5c0f\u4e8e phpcms \u8bbe\u7f6e\u7684\u6700\u5927\u4e0a\u4f20\u9650\u5236\u3002\u53ef\u4ee5\u5728 phpcms \u540e\u53f0\u7684\u201c\u7cfb\u7edf\u201d-&gt;\u201c\u9644\u4ef6\u8bbe\u7f6e\u201d\u4e2d\u67e5\u770b\u548c\u4fee\u6539\u8be5\u9650\u5236\u3002 3. \u68c0\u67e5\u670d\u52a1\u5668\u914d\u7f6e \u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u6b63\u786e\u914d\u7f6e\u4e86 PHP GD \u5e93\uff0c\u8be5\u5e93\u7528\u4e8e\u5904\u7406\u56fe\u50cf\u3002\u5982\u679c\u672a\u6b63\u786e\u914d\u7f6e\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u56fe\u7247\u65e0\u6cd5\u4e0a\u4f20\u6216\u663e\u793a\u3002 4. \u68c0\u67e5 php.ini \u8bbe\u7f6e \u786e\u4fdd php.ini \u6587\u4ef6\u4e2d\u8bbe\u7f6e\u4e86\u6b63\u786e\u7684 file_uploads \u9009\u9879\u4e3a On\uff0c\u5e76\u4e14 upload_max_filesize \u548c upload_tmp_dir \u9009\u9879\u8bbe\u7f6e\u6b63\u786e\u3002 5. \u542f\u7528 GD \u5e93 \u5728\u670d\u52a1\u5668\u4e2d\u542f\u7528 PHP GD \u5e93\uff0c\u53ef\u4ee5\u5728 php.ini \u6587\u4ef6\u4e2d\u627e\u5230\u5e76\u6253\u5f00 extension=gd \u6216 extension=gd2 \u884c\u3002 6. \u68c0\u67e5\u4e34\u65f6\u76ee\u5f55\u6743\u9650 \u786e\u4fdd php.ini [&hellip;]<\/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-34253","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/34253","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=34253"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/34253\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=34253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=34253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=34253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}