{"id":31139,"date":"2024-11-25T17:19:43","date_gmt":"2024-11-25T09:19:43","guid":{"rendered":"https:\/\/fwq.ai\/blog\/31139\/"},"modified":"2024-11-25T17:19:43","modified_gmt":"2024-11-25T09:19:43","slug":"phpcms-uploadfile%e4%b8%8d%e5%8f%af%e5%86%99%e6%80%8e%e4%b9%88%e5%8a%9e","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/31139\/","title":{"rendered":"phpcms uploadfile\u4e0d\u53ef\u5199\u600e\u4e48\u529e"},"content":{"rendered":"<p style=\"text-align: center\"><strong><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/000\/020\/5e1e68646d203173.jpg\" class=\"aligncenter\" title=\"phpcms uploadfile\u4e0d\u53ef\u5199\u600e\u4e48\u529e\u63d2\u56fe\" alt=\"phpcms uploadfile\u4e0d\u53ef\u5199\u600e\u4e48\u529e\u63d2\u56fe\" \/><\/strong><\/p>\n<p><strong> uploadfile\u4e0d\u53ef\u5199\u600e\u4e48\u529e\uff1f<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/image\/197\/644\/664\/1579051006102245.png\" class=\"aligncenter\" title=\"phpcms uploadfile\u4e0d\u53ef\u5199\u600e\u4e48\u529e\u63d2\u56fe1\" alt=\"phpcms uploadfile\u4e0d\u53ef\u5199\u600e\u4e48\u529e\u63d2\u56fe1\" \/><\/p>\n<p>1.&nbsp; \u5c06\/var\/www\/html\/phpcms\u76ee\u5f55\u6240\u5c5e\u7528\u6237\u548c\u7ec4\u4fee\u6539\u4e3aapache<\/p>\n<pre>[root@localhost&nbsp;html]#&nbsp;\n[root@localhost&nbsp;html]#&nbsp;pwd\n\/var\/www\/html\n[root@localhost&nbsp;html]#&nbsp;ls&nbsp;\nindex.php&nbsp;&nbsp;itop&nbsp;&nbsp;phpcms\n[root@localhost&nbsp;html]#&nbsp;\n[root@localhost&nbsp;html]#&nbsp;chown&nbsp;-R&nbsp;apache:apache&nbsp;phpcms\/\n[root@localhost&nbsp;html]#&nbsp;\n[root@localhost&nbsp;html]#<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>2. \u5c06\/var\/www\/html\/phpcms\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6\u6743\u9650\u8bbe\u7f6e644\uff0c\u76ee\u5f55\u6743\u9650\u8bbe\u7f6e\u4e3a755<\/p>\n<pre>[root@localhost&nbsp;html]#&nbsp;\n[root@localhost&nbsp;html]#&nbsp;find&nbsp;phpcms\/*&nbsp;-type&nbsp;f&nbsp;-exec&nbsp;chmod&nbsp;644&nbsp;{}&nbsp;;\n[root@localhost&nbsp;html]#&nbsp;find&nbsp;phpcms\/*&nbsp;-type&nbsp;d&nbsp;-exec&nbsp;chmod&nbsp;755&nbsp;{}&nbsp;;\n[root@localhost&nbsp;html]#<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>&nbsp;&nbsp;<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p>3. \u67e5\u770b\/var\/www\/html\/phpcms\u4e0b\u76ee\u5f55\u548c\u6587\u4ef6\u6743\u9650\u4fe1\u606f<\/p>\n<pre>[root@localhost&nbsp;html]#&nbsp;\n[root@localhost&nbsp;html]#&nbsp;cd&nbsp;phpcms\/\n[root@localhost&nbsp;phpcms]#&nbsp;ls&nbsp;-lhd&nbsp;\ndrwxr-xr-x.&nbsp;9&nbsp;apache&nbsp;apache&nbsp;4.0K&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;17:23&nbsp;.\n[root@localhost&nbsp;phpcms]#&nbsp;\n[root@localhost&nbsp;phpcms]#&nbsp;ls&nbsp;-lh\n\u603b\u7528\u91cf&nbsp;60K\n-rw-r--r--.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;&nbsp;&nbsp;48&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;admin.php\ndrwxr-xr-x.&nbsp;&nbsp;3&nbsp;apache&nbsp;apache&nbsp;4.0K&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;api\n-rw-r--r--.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;&nbsp;991&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;api.php\ndrwxr-xr-x.&nbsp;17&nbsp;apache&nbsp;apache&nbsp;4.0K&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;17:23&nbsp;caches\n-rw-r--r--.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;&nbsp;104&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;crossdomain.xml\n-rw-r--r--.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;3.1K&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;favicon.ico\ndrwxr-xr-x.&nbsp;&nbsp;2&nbsp;apache&nbsp;apache&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;17:20&nbsp;html\n-rw-r--r--.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;8.1K&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;19:53&nbsp;index.html\n-rw-r--r--.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;&nbsp;318&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;index.php\n-rw-r--r--.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;&nbsp;523&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;js.html\ndrwxr-xr-x.&nbsp;10&nbsp;apache&nbsp;apache&nbsp;4.0K&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;phpcms\ndrwxr-xr-x.&nbsp;&nbsp;7&nbsp;apache&nbsp;apache&nbsp;4.0K&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;phpsso_server\n-rw-r--r--.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;3.6K&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;plugin.php\n-rw-r--r--.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;&nbsp;170&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;robots.txt\ndrwxr-xr-x.&nbsp;&nbsp;6&nbsp;apache&nbsp;apache&nbsp;&nbsp;&nbsp;51&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;statics\ndrwxr-xr-x.&nbsp;&nbsp;3&nbsp;apache&nbsp;apache&nbsp;&nbsp;&nbsp;19&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;17:20&nbsp;uploadfile\n[root@localhost&nbsp;phpcms]#&nbsp;\n[root@localhost&nbsp;phpcms]#<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>4. \u91cd\u65b0\u68c0\u6d4b\u201c\u6587\u4ef6\u6743\u9650\u8bbe\u7f6e\u201d\uff0c\u5df2\u901a\u8fc7<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/image\/284\/509\/764\/1579051025382592.png\" class=\"aligncenter\" title=\"phpcms uploadfile\u4e0d\u53ef\u5199\u600e\u4e48\u529e\u63d2\u56fe2\" alt=\"phpcms uploadfile\u4e0d\u53ef\u5199\u600e\u4e48\u529e\u63d2\u56fe2\" \/><\/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 uploadfile\u4e0d\u53ef\u5199\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>uploadfile\u4e0d\u53ef\u5199\u600e\u4e48\u529e\uff1f 1.&nbsp; \u5c06\/var\/www\/html\/phpcms\u76ee\u5f55\u6240\u5c5e\u7528\u6237\u548c\u7ec4\u4fee\u6539\u4e3aapache [root@localhost&nbsp;html]#&nbsp; [root@localhost&nbsp;html]#&nbsp;pwd \/var\/www\/html [root@localhost&nbsp;html]#&nbsp;ls&nbsp; index.php&nbsp;&nbsp;itop&nbsp;&nbsp;phpcms [root@localhost&nbsp;html]#&nbsp; [root@localhost&nbsp;html]#&nbsp;chown&nbsp;-R&nbsp;apache:apache&nbsp;phpcms\/ [root@localhost&nbsp;html]#&nbsp; [root@localhost&nbsp;html]# \u767b\u5f55\u540e\u590d\u5236 2. \u5c06\/var\/www\/html\/phpcms\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6\u6743\u9650\u8bbe\u7f6e644\uff0c\u76ee\u5f55\u6743\u9650\u8bbe\u7f6e\u4e3a755 [root@localhost&nbsp;html]#&nbsp; [root@localhost&nbsp;html]#&nbsp;find&nbsp;phpcms\/*&nbsp;-type&nbsp;f&nbsp;-exec&nbsp;chmod&nbsp;644&nbsp;{}&nbsp;; [root@localhost&nbsp;html]#&nbsp;find&nbsp;phpcms\/*&nbsp;-type&nbsp;d&nbsp;-exec&nbsp;chmod&nbsp;755&nbsp;{}&nbsp;; [root@localhost&nbsp;html]# \u767b\u5f55\u540e\u590d\u5236 &nbsp;&nbsp; \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b 3. \u67e5\u770b\/var\/www\/html\/phpcms\u4e0b\u76ee\u5f55\u548c\u6587\u4ef6\u6743\u9650\u4fe1\u606f [root@localhost&nbsp;html]#&nbsp; [root@localhost&nbsp;html]#&nbsp;cd&nbsp;phpcms\/ [root@localhost&nbsp;phpcms]#&nbsp;ls&nbsp;-lhd&nbsp; drwxr-xr-x.&nbsp;9&nbsp;apache&nbsp;apache&nbsp;4.0K&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;17:23&nbsp;. [root@localhost&nbsp;phpcms]#&nbsp; [root@localhost&nbsp;phpcms]#&nbsp;ls&nbsp;-lh \u603b\u7528\u91cf&nbsp;60K -rw-r&#8211;r&#8211;.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;&nbsp;&nbsp;48&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;admin.php drwxr-xr-x.&nbsp;&nbsp;3&nbsp;apache&nbsp;apache&nbsp;4.0K&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;api -rw-r&#8211;r&#8211;.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;&nbsp;991&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;api.php drwxr-xr-x.&nbsp;17&nbsp;apache&nbsp;apache&nbsp;4.0K&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;17:23&nbsp;caches -rw-r&#8211;r&#8211;.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;&nbsp;104&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;crossdomain.xml -rw-r&#8211;r&#8211;.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;3.1K&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;favicon.ico drwxr-xr-x.&nbsp;&nbsp;2&nbsp;apache&nbsp;apache&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;17:20&nbsp;html -rw-r&#8211;r&#8211;.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;8.1K&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;19:53&nbsp;index.html -rw-r&#8211;r&#8211;.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;&nbsp;318&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;index.php -rw-r&#8211;r&#8211;.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;&nbsp;523&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;js.html drwxr-xr-x.&nbsp;10&nbsp;apache&nbsp;apache&nbsp;4.0K&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;phpcms drwxr-xr-x.&nbsp;&nbsp;7&nbsp;apache&nbsp;apache&nbsp;4.0K&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;phpsso_server -rw-r&#8211;r&#8211;.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;3.6K&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;plugin.php -rw-r&#8211;r&#8211;.&nbsp;&nbsp;1&nbsp;apache&nbsp;apache&nbsp;&nbsp;170&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;robots.txt drwxr-xr-x.&nbsp;&nbsp;6&nbsp;apache&nbsp;apache&nbsp;&nbsp;&nbsp;51&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;00:46&nbsp;statics drwxr-xr-x.&nbsp;&nbsp;3&nbsp;apache&nbsp;apache&nbsp;&nbsp;&nbsp;19&nbsp;1\u6708&nbsp;&nbsp;&nbsp;7&nbsp;17:20&nbsp;uploadfile [root@localhost&nbsp;phpcms]#&nbsp; [root@localhost&nbsp;phpcms]# \u767b\u5f55\u540e\u590d\u5236 4. \u91cd\u65b0\u68c0\u6d4b\u201c\u6587\u4ef6\u6743\u9650\u8bbe\u7f6e\u201d\uff0c\u5df2\u901a\u8fc7 PHP\u4e2d\u6587\u7f51\uff0c\u5927\u91cf\u7684\u514d\u8d39\uff0c\u6b22\u8fce\u5728\u7ebf\u5b66\u4e60\uff01 \u4ee5\u4e0a\u5c31\u662f uploadfile\u4e0d\u53ef\u5199\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-31139","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31139","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=31139"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/31139\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=31139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=31139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=31139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}