{"id":31834,"date":"2024-11-25T11:56:21","date_gmt":"2024-11-25T03:56:21","guid":{"rendered":"https:\/\/fwq.ai\/blog\/31834\/"},"modified":"2024-11-25T11:56:21","modified_gmt":"2024-11-25T03:56:21","slug":"wordpress%e4%b8%8d%e8%83%bd%e5%b0%86%e4%b8%8a%e4%bc%a0%e7%9a%84%e6%96%87%e4%bb%b6%e7%a7%bb%e5%8a%a8%e8%87%b3wp-content-uploads","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/31834\/","title":{"rendered":"WordPress\u4e0d\u80fd\u5c06\u4e0a\u4f20\u7684\u6587\u4ef6\u79fb\u52a8\u81f3wp-content\/uploads"},"content":{"rendered":"<p>\u4e0b\u9762\u7531\/&#8221; target=&#8221;_blank&#8221;&gt;<strong>wordpress\u6559\u7a0b<\/strong>\u680f\u76ee\u7ed9\u5927\u5bb6\u4ecb\u7ecdwordpress\u4e2d\u65e0\u6cd5\u5c06\u4e0a\u4f20\u7684\u6587\u4ef6\u79fb\u52a8\u81f3wp-content\/uploads\u7684\u89e3\u51b3\u529e\u6cd5\uff0c\u5e0c\u671b\u5bf9\u9700\u8981\u7684\u670b\u53cb\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5fc8857b67cc7668.jpg\" class=\"aligncenter\" title=\"WordPress\u4e0d\u80fd\u5c06\u4e0a\u4f20\u7684\u6587\u4ef6\u79fb\u52a8\u81f3wp-content\/uploads\u63d2\u56fe\" alt=\"WordPress\u4e0d\u80fd\u5c06\u4e0a\u4f20\u7684\u6587\u4ef6\u79fb\u52a8\u81f3wp-content\/uploads\u63d2\u56fe\" \/><\/p>\n<p><strong>\u89e3\u51b3WordPress\u4e2d\u65e0\u6cd5\u5c06\u4e0a\u4f20\u7684\u6587\u4ef6\u79fb\u52a8\u81f3wp-content\/uploads<\/strong><\/p>\n<p>\u642d\u5efalnmp\u73af\u5883\uff0c\u653e\u4e00\u4e2awordpress\u5efa\u7ad9\u7cfb\u7edf<\/p>\n<p>lnmp\u73af\u5883\u5f88\u5feb\u5c31\u642d\u5efa\u5b8c\u6210\u4e86\uff0c\u4f46\u662f\u5728\u653ewordpress\u7684\u65f6\u5019\u51fa\u73b0\u4e86\u4e00\u4e9b\u95ee\u9898<\/p>\n<p>\u6700\u4e3b\u8981\u7684\u95ee\u9898\uff1a<\/p>\n<p>1.\u7b2c\u4e00\u4e2a\u662fwp-content\/uploads\u6ca1\u6709\u6743\u9650\u521b\u5efa\uff0c<\/p>\n<p>&nbsp; &nbsp;\u3000\u3000\u8fd9\u4e2a\u81ea\u5df1\u624b\u52a8\u521b\u5efa\u4e00\u4e0b\uff0c\u7ed9\u4e2a777\u6743\u9650\u5c31\u597d\u4e86\u3002<\/p>\n<p>2.\u65e0\u6cd5\u5c06\u4e0a\u4f20\u7684\u6587\u4ef6\u79fb\u52a8\u81f3wp-content\/uploads\u3002<\/p>\n<p>\u3000\u3000\u8fd9\u662f\u4e2a\u4e3b\u8981\u7684\u95ee\u9898\uff0c\u4e5f\u662f\u6bd4\u8f83\u9ebb\u70e6\u7684\u95ee\u9898\uff0c\u767e\u5ea6\u7684\u7b54\u6848\u90fd\u662f\u5343\u7bc7\u4e00\u5f8b\u7684\u8bbe\u7f6e777\u6743\u9650\uff0c\u4e0d\u8981\u4e2d\u6587\u7528\u6237\u540d\uff0c<\/p>\n<p>\u3000\u3000\u6ca1\u6709\u4e00\u70b9\u7528\u3002<\/p>\n<p>\u3000\u3000\u5728\u83b7\u5f97\u89e3\u51b3\u529e\u6cd5\u4e4b\u524d\u9996\u5148\u63cf\u8ff0\u4e00\u4e0b\u80cc\u666f<\/p>\n<p>\u3000\u3000\u88c5lnmp\u73af\u5883\u7684\u65f6\u5019\u5168\u90e8\u662f\u4f7f\u7528root\u7528\u6237\u5b89\u88c5\u7684\uff0c\u4f46\u662f\u5f53\u6211\u653e\u7a0b\u5e8f\u7684\u65f6\u5019\u662f\u65b0\u521b\u5efa\u4e86\u4e00\u4e2amorequ\u7528\u6237\uff0c\u7a0b\u5e8f\u5168\u90e8\u653e\u5230\u8fd9\u4e2a\u7528\u6237\u4e0b\uff0c\u7136\u540e\u7528nginx\u4ee3\u7406\u3002<\/p>\n<p>\u3000\u3000\u8fd9\u5c31\u51fa\u73b0\u4e86\u6743\u9650\u95ee\u9898\u3002<\/p>\n<p>\u3000\u3000\u7ffb\u904d\u4e86\u767e\u5ea6\uff0c\u4e00\u70b9\u7528\u90fd\u6ca1\u6709\uff0c\u6700\u540e\u7528bing\u641c\u7d22\u5f97\u5230\u4e86\u4e00\u4e2a\u7b54\u6848\u3002<\/p>\n<p>\u6309\u7167\u4ed6\u7684\u65b9\u6cd5\u6539\u4e86\u4e4b\u540e\uff0c\u8fdehttp\u90fd\u8fc7\u4e0d\u53bb\uff0c\u76f4\u63a5500\u4e86\uff0c\u7ecf\u8fc7\u591a\u756a\u52aa\u529b\uff0c\u6700\u7ec8\u5f97\u5230\u7b54\u6848\u3002<\/p>\n<p>\u3000\u3000a\uff09\u4fee\u6539nginx.conf<\/p>\n<p>&nbsp; &nbsp; \u5728\u8fd9\u4e2a\u6587\u4ef6\u7684\u6700\u5f00\u59cb\uff0c\u6709\u4e2a\u8bbe\u7f6euser\u7684\u5730\u65b9\uff0c\u4fee\u6539\u4e3a\uff1a<\/p>\n<pre>user&nbsp;&nbsp;root&nbsp;root;\nworker_processes&nbsp;&nbsp;1;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>&nbsp; &nbsp; &nbsp; b\uff09\u4fee\u6539php-fpm.conf<\/p>\n<p>&nbsp;\u3000\u3000\u5728\u8fd9\u4e2a\u6587\u4ef6\u91cc\u770b\u5230\u8fd9\u4e48\u4e00\u53e5\u8bdd\uff1a<\/p>\n<pre>;&nbsp;Include&nbsp;one&nbsp;or&nbsp;more&nbsp;files.&nbsp;If&nbsp;glob(3)&nbsp;exists,&nbsp;it&nbsp;is&nbsp;used&nbsp;to&nbsp;include&nbsp;a&nbsp;bunch&nbsp;of\n;&nbsp;files&nbsp;from&nbsp;a&nbsp;glob(3)&nbsp;pattern.&nbsp;This&nbsp;directive&nbsp;can&nbsp;be&nbsp;used&nbsp;everywhere&nbsp;in&nbsp;the\n;&nbsp;file.\ninclude=\/etc\/php-fpm.d\/*.conf<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>&nbsp; &nbsp; &nbsp;\u53ef\u4ee5\u8fdb\u5165\u8fd9\u4e2a\u6587\u4ef6\u5939\u770b\u4e00\u4e0b\uff0c\u5176\u4e2d\u6709\u4e00\u4e2awww.conf\u6587\u4ef6<\/p>\n<p>\u3000\u3000\u4fee\u6539\u8fd9\u4e2a\u6587\u4ef6\u7684\uff1a<\/p>\n<pre>;&nbsp;Set&nbsp;permissions&nbsp;for&nbsp;unix&nbsp;socket,&nbsp;if&nbsp;one&nbsp;is&nbsp;used.&nbsp;In&nbsp;Linux,&nbsp;read\/write\n;&nbsp;permissions&nbsp;must&nbsp;be&nbsp;set&nbsp;in&nbsp;order&nbsp;to&nbsp;allow&nbsp;connections&nbsp;from&nbsp;a&nbsp;web&nbsp;server.&nbsp;Many\n;&nbsp;BSD-derived&nbsp;systems&nbsp;allow&nbsp;connections&nbsp;regardless&nbsp;of&nbsp;permissions.\n;&nbsp;Default&nbsp;Values:&nbsp;user&nbsp;and&nbsp;group&nbsp;are&nbsp;set&nbsp;as&nbsp;the&nbsp;running&nbsp;user\n;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mode&nbsp;is&nbsp;set&nbsp;to&nbsp;0666\n;listen.owner&nbsp;=&nbsp;morequ\n;listen.group&nbsp;=&nbsp;morequ\n;listen.mode&nbsp;=&nbsp;0666\n;&nbsp;Unix&nbsp;user\/group&nbsp;of&nbsp;processes\n;&nbsp;Note:&nbsp;The&nbsp;user&nbsp;is&nbsp;mandatory.&nbsp;If&nbsp;the&nbsp;group&nbsp;is&nbsp;not&nbsp;set,&nbsp;the&nbsp;default&nbsp;user's&nbsp;group\n;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;will&nbsp;be&nbsp;used.\n;&nbsp;RPM:&nbsp;apache&nbsp;Choosed&nbsp;to&nbsp;be&nbsp;able&nbsp;to&nbsp;access&nbsp;some&nbsp;dir&nbsp;as&nbsp;httpd\nuser&nbsp;=&nbsp;morequ\n;&nbsp;RPM:&nbsp;Keep&nbsp;a&nbsp;group&nbsp;allowed&nbsp;to&nbsp;write&nbsp;in&nbsp;log&nbsp;dir.\ngroup&nbsp;=&nbsp;morequ<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>&nbsp;\u3000\u3000\u5c06\u672c\u6765\u7684www\u7528\u6237\u6539\u4e3a\u6211\u5f53\u524d\u7684\u7528\u6237\u3002<\/p>\n<p>\u3000\u3000\u7ed3\u679c\u6210\u529f\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fWordPress\u4e0d\u80fd\u5c06\u4e0a\u4f20\u7684\u6587\u4ef6\u79fb\u52a8\u81f3wp-content\/uploads\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>\u4e0b\u9762\u7531\/&#8221; target=&#8221;_blank&#8221;&gt;wordpress\u6559\u7a0b\u680f\u76ee\u7ed9\u5927\u5bb6\u4ecb\u7ecdwordpress\u4e2d\u65e0\u6cd5\u5c06\u4e0a\u4f20\u7684\u6587\u4ef6\u79fb\u52a8\u81f3wp-content\/uploads\u7684\u89e3\u51b3\u529e\u6cd5\uff0c\u5e0c\u671b\u5bf9\u9700\u8981\u7684\u670b\u53cb\u6709\u6240\u5e2e\u52a9\uff01 \u89e3\u51b3WordPress\u4e2d\u65e0\u6cd5\u5c06\u4e0a\u4f20\u7684\u6587\u4ef6\u79fb\u52a8\u81f3wp-content\/uploads \u642d\u5efalnmp\u73af\u5883\uff0c\u653e\u4e00\u4e2awordpress\u5efa\u7ad9\u7cfb\u7edf lnmp\u73af\u5883\u5f88\u5feb\u5c31\u642d\u5efa\u5b8c\u6210\u4e86\uff0c\u4f46\u662f\u5728\u653ewordpress\u7684\u65f6\u5019\u51fa\u73b0\u4e86\u4e00\u4e9b\u95ee\u9898 \u6700\u4e3b\u8981\u7684\u95ee\u9898\uff1a 1.\u7b2c\u4e00\u4e2a\u662fwp-content\/uploads\u6ca1\u6709\u6743\u9650\u521b\u5efa\uff0c &nbsp; &nbsp;\u3000\u3000\u8fd9\u4e2a\u81ea\u5df1\u624b\u52a8\u521b\u5efa\u4e00\u4e0b\uff0c\u7ed9\u4e2a777\u6743\u9650\u5c31\u597d\u4e86\u3002 2.\u65e0\u6cd5\u5c06\u4e0a\u4f20\u7684\u6587\u4ef6\u79fb\u52a8\u81f3wp-content\/uploads\u3002 \u3000\u3000\u8fd9\u662f\u4e2a\u4e3b\u8981\u7684\u95ee\u9898\uff0c\u4e5f\u662f\u6bd4\u8f83\u9ebb\u70e6\u7684\u95ee\u9898\uff0c\u767e\u5ea6\u7684\u7b54\u6848\u90fd\u662f\u5343\u7bc7\u4e00\u5f8b\u7684\u8bbe\u7f6e777\u6743\u9650\uff0c\u4e0d\u8981\u4e2d\u6587\u7528\u6237\u540d\uff0c \u3000\u3000\u6ca1\u6709\u4e00\u70b9\u7528\u3002 \u3000\u3000\u5728\u83b7\u5f97\u89e3\u51b3\u529e\u6cd5\u4e4b\u524d\u9996\u5148\u63cf\u8ff0\u4e00\u4e0b\u80cc\u666f \u3000\u3000\u88c5lnmp\u73af\u5883\u7684\u65f6\u5019\u5168\u90e8\u662f\u4f7f\u7528root\u7528\u6237\u5b89\u88c5\u7684\uff0c\u4f46\u662f\u5f53\u6211\u653e\u7a0b\u5e8f\u7684\u65f6\u5019\u662f\u65b0\u521b\u5efa\u4e86\u4e00\u4e2amorequ\u7528\u6237\uff0c\u7a0b\u5e8f\u5168\u90e8\u653e\u5230\u8fd9\u4e2a\u7528\u6237\u4e0b\uff0c\u7136\u540e\u7528nginx\u4ee3\u7406\u3002 \u3000\u3000\u8fd9\u5c31\u51fa\u73b0\u4e86\u6743\u9650\u95ee\u9898\u3002 \u3000\u3000\u7ffb\u904d\u4e86\u767e\u5ea6\uff0c\u4e00\u70b9\u7528\u90fd\u6ca1\u6709\uff0c\u6700\u540e\u7528bing\u641c\u7d22\u5f97\u5230\u4e86\u4e00\u4e2a\u7b54\u6848\u3002 \u6309\u7167\u4ed6\u7684\u65b9\u6cd5\u6539\u4e86\u4e4b\u540e\uff0c\u8fdehttp\u90fd\u8fc7\u4e0d\u53bb\uff0c\u76f4\u63a5500\u4e86\uff0c\u7ecf\u8fc7\u591a\u756a\u52aa\u529b\uff0c\u6700\u7ec8\u5f97\u5230\u7b54\u6848\u3002 \u3000\u3000a\uff09\u4fee\u6539nginx.conf &nbsp; &nbsp; \u5728\u8fd9\u4e2a\u6587\u4ef6\u7684\u6700\u5f00\u59cb\uff0c\u6709\u4e2a\u8bbe\u7f6euser\u7684\u5730\u65b9\uff0c\u4fee\u6539\u4e3a\uff1a user&nbsp;&nbsp;root&nbsp;root; worker_processes&nbsp;&nbsp;1; \u767b\u5f55\u540e\u590d\u5236 &nbsp; &nbsp; &nbsp; b\uff09\u4fee\u6539php-fpm.conf &nbsp;\u3000\u3000\u5728\u8fd9\u4e2a\u6587\u4ef6\u91cc\u770b\u5230\u8fd9\u4e48\u4e00\u53e5\u8bdd\uff1a ;&nbsp;Include&nbsp;one&nbsp;or&nbsp;more&nbsp;files.&nbsp;If&nbsp;glob(3)&nbsp;exists,&nbsp;it&nbsp;is&nbsp;used&nbsp;to&nbsp;include&nbsp;a&nbsp;bunch&nbsp;of ;&nbsp;files&nbsp;from&nbsp;a&nbsp;glob(3)&nbsp;pattern.&nbsp;This&nbsp;directive&nbsp;can&nbsp;be&nbsp;used&nbsp;everywhere&nbsp;in&nbsp;the ;&nbsp;file. include=\/etc\/php-fpm.d\/*.conf \u767b\u5f55\u540e\u590d\u5236 &nbsp; &nbsp; &nbsp;\u53ef\u4ee5\u8fdb\u5165\u8fd9\u4e2a\u6587\u4ef6\u5939\u770b\u4e00\u4e0b\uff0c\u5176\u4e2d\u6709\u4e00\u4e2awww.conf\u6587\u4ef6 \u3000\u3000\u4fee\u6539\u8fd9\u4e2a\u6587\u4ef6\u7684\uff1a ;&nbsp;Set&nbsp;permissions&nbsp;for&nbsp;unix&nbsp;socket,&nbsp;if&nbsp;one&nbsp;is&nbsp;used.&nbsp;In&nbsp;Linux,&nbsp;read\/write ;&nbsp;permissions&nbsp;must&nbsp;be&nbsp;set&nbsp;in&nbsp;order&nbsp;to&nbsp;allow&nbsp;connections&nbsp;from&nbsp;a&nbsp;web&nbsp;server.&nbsp;Many ;&nbsp;BSD-derived&nbsp;systems&nbsp;allow&nbsp;connections&nbsp;regardless&nbsp;of&nbsp;permissions. ;&nbsp;Default&nbsp;Values:&nbsp;user&nbsp;and&nbsp;group&nbsp;are&nbsp;set&nbsp;as&nbsp;the&nbsp;running&nbsp;user ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mode&nbsp;is&nbsp;set&nbsp;to&nbsp;0666 ;listen.owner&nbsp;=&nbsp;morequ ;listen.group&nbsp;=&nbsp;morequ ;listen.mode&nbsp;=&nbsp;0666 ;&nbsp;Unix&nbsp;user\/group&nbsp;of&nbsp;processes ;&nbsp;Note:&nbsp;The&nbsp;user&nbsp;is&nbsp;mandatory.&nbsp;If&nbsp;the&nbsp;group&nbsp;is&nbsp;not&nbsp;set,&nbsp;the&nbsp;default&nbsp;user&#8217;s&nbsp;group ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;will&nbsp;be&nbsp;used. ;&nbsp;RPM:&nbsp;apache&nbsp;Choosed&nbsp;to&nbsp;be&nbsp;able&nbsp;to&nbsp;access&nbsp;some&nbsp;dir&nbsp;as&nbsp;httpd user&nbsp;=&nbsp;morequ ;&nbsp;RPM:&nbsp;Keep&nbsp;a&nbsp;group&nbsp;allowed&nbsp;to&nbsp;write&nbsp;in&nbsp;log&nbsp;dir. group&nbsp;=&nbsp;morequ \u767b\u5f55\u540e\u590d\u5236 &nbsp;\u3000\u3000\u5c06\u672c\u6765\u7684www\u7528\u6237\u6539\u4e3a\u6211\u5f53\u524d\u7684\u7528\u6237\u3002 [&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-31834","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31834","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=31834"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31834\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=31834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=31834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=31834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}