{"id":777,"date":"2013-01-14T12:26:01","date_gmt":"2013-01-14T04:26:01","guid":{"rendered":"http:\/\/hesiwei.cn\/?p=777"},"modified":"2013-01-14T12:26:01","modified_gmt":"2013-01-14T04:26:01","slug":"%e8%a7%a3%e5%86%b3wordpress%e5%ae%89%e8%a3%85%e5%88%a0%e9%99%a4%e4%b8%bb%e9%a2%98%e6%8f%92%e4%bb%b6%e9%9c%80%e8%a6%81ftp%e7%94%a8%e6%88%b7%e5%90%8d%e5%af%86%e7%a0%81%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/hesiwei.cn\/?p=777","title":{"rendered":"\u89e3\u51b3wordpress\u5b89\u88c5\u5220\u9664\u4e3b\u9898\u63d2\u4ef6\u9700\u8981FTP\u7528\u6237\u540d\u5bc6\u7801\u7684\u95ee\u9898"},"content":{"rendered":"<p>VPS \u5b89\u88c5wordpress\u540e\uff0c\u5728\u540e\u53f0\u81ea\u52a8\u5347\u7ea7\u65f6\uff0c\u6216\u8005\u66f4\u65b0\u3001\u5220\u9664\u4e3b\u9898\u6216\u8005\u63d2\u4ef6\u7684\u65f6\u5019\uff0c\u5982\u679c\u63d0\u793a\u9700\u8981\u8f93\u5165FTP\u8d26\u6237\u4fe1\u606f\uff0c\u6709\u65f6\u5373\u4f7f\u6211\u4eec\u6b63\u786e\u8f93\u5165\u4e86FTP\u7528\u6237\u540d \u548c\u5bc6\u7801\u4e5f\u65e0\u6cd5\u5b8c\u6210\u5347\u7ea7\uff0c\u8fd9\u4e2a\u662f\u670d\u52a1\u5668\u7aef\u7684\u6743\u9650\u8bbe\u7f6e\u95ee\u9898\uff0c\u4e0d\u662f\u7528\u6237\u7684\u95ee\u9898\u3002\u5982\u679c\u4f60\u662f\u7ba1\u7406\u5458\uff0c\u4e5f\u9047\u5230\u4e86\u8fd9\u6837\u7684\u95ee\u9898\u53ef\u4ee5\u53c2\u8003\u4e0b\u9762\u63d0\u4f9b\u51e0\u4e2a\u65b9\u6cd5\uff1a<\/p>\n<p>\u4e00\u3001\u5982\u679c\u4f7f\u7528\u865a\u62df\u4e3b\u673a<\/p>\n<p>\u65b9\u6cd51\u3001\u53ef\u4ee5\u5728wp-config.php\u91cc\u52a0\u5165\u4e0b\u9762\u4ee3\u7801:<br \/>\ndefine(&#8220;FS_METHOD&#8221;, &#8220;direct&#8221;);<br \/>\ndefine(&#8220;FS_CHMOD_DIR&#8221;, 0777);<br \/>\ndefine(&#8220;FS_CHMOD_FILE&#8221;, 0777);<br \/>\n<!--more--><br \/>\n\u65b9\u6cd52\u3001\u62f7\u8d1d\u4e0b\u9762\u7684\u4ee3\u7801\u5230wp-config.php\u4e2d\u7684?&gt;\u4e4b\u524d<br \/>\n\/** Override default file permissions *\/<br \/>\nif(is_admin()) {<br \/>\nadd_filter(&#8216;filesystem_method&#8217;,create_function(&#8216;$a&#8217;,&#8217;return &#8220;direct&#8221;;&#8217;));<br \/>\ndefine(&#8216;FS_CHMOD_DIR&#8217;, 0751);<br \/>\n}<\/p>\n<p>\u65b9\u6cd53\u3001\u4fee\u6539FTP\u76f8\u5173\u4fe1\u606f\u4e4b\u540e\uff0c\u62f7\u8d1d\u4ee3\u7801\u5230wp-config.php\u7684?&gt;\u4e4b\u524d<br \/>\n\/\/*added ftp login credentials to avoid the annoying prompt asking for login info every time I wanted to upgrade a plugin*<br \/>\ndefine(&#8216;FTP_HOST&#8217;, &#8216;ftp.yoursite.com&#8217;);<br \/>\ndefine(&#8216;FTP_USER&#8217;, &#8216;Your_FTP_Username&#8217;);<br \/>\ndefine(&#8216;FTP_PASS&#8217;, &#8216;Your_FTP_password&#8217;);<br \/>\n\/\/*If you can use a SSL connection set this to true*<br \/>\ndefine(&#8216;FTP_SSL&#8217;, true);<\/p>\n<p>\u4e8c\u3001\u5982\u679c\u4f7f\u7528\u72ec\u7acb\u670d\u52a1\u5668\u6216VPS\uff0c\u53ef\u4ee5\u4fee\u6539\u7f51\u7ad9\u6240\u5728\u76ee\u5f55\u5c5e\u6027\uff1a<\/p>\n<p>chmod -R 755 \/home\/wwwroot<br \/>\nchown -R www \/home\/wwwroot<br \/>\n\u5176\u5b9e\u51fa\u73b0\u8fd9\u4e2a\u7684\u95ee\u9898\u5c31\u662fApache\/Nginx\u7684\u6267\u884c\u8eab\u4efd\u975e\u6587\u4ef6\u5c5e\u4e3b\u8eab\u4efd\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a<br \/>\n\u5047\u8bbe\u4f60\u7684wordpress\u5b89\u88c5\u76ee\u5f55\u4e3a\/home\/wwwroot\/wordpress<br \/>\n\u6267\u884c\uff1a<br \/>\nchown -R www \/home\/wwwroot\/wordpress<br \/>\n\u6267\u884c\u4e0a\u9762\u7684\u547d\u4ee4\u5c31\u53ef\u4ee5\u5c06\/home\/wwwroot\/wordpress\u4e0b\u6240\u6709\u6587\u4ef6\u7684\u5c5e\u4e3b\u6539\u4e3awww\uff0c<\/p>\n<p>\u201cwww\u201d\u6362\u6210\u4f60\u81ea\u5df1\u7684ftp\u7528\u6237\u540d\uff0c\u201c\/home\/wwwroot\/wordpress\u201d\u6362\u6210\u4f60\u81ea\u5df1\u7684wordpress\u5b89\u88c5\u76ee\u3002<\/p>\n<p>\u8fd9\u6837\u5c31\u53ef\u4ee5\u89e3\u51b3\u81ea\u52a8\u66f4\u65b0\u5fc5\u987b\u586bFTP\u7684\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VPS \u5b89\u88c5wordpress\u540e\uff0c\u5728\u540e\u53f0\u81ea\u52a8\u5347\u7ea7\u65f6\uff0c\u6216\u8005\u66f4\u65b0\u3001\u5220\u9664\u4e3b\u9898\u6216\u8005\u63d2\u4ef6\u7684\u65f6\u5019\uff0c\u5982\u679c\u63d0\u793a\u9700\u8981\u8f93\u5165FTP\u8d26 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-777","post","type-post","status-publish","format-standard","hentry","category-wp"],"_links":{"self":[{"href":"http:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/posts\/777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/hesiwei.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=777"}],"version-history":[{"count":0,"href":"http:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/posts\/777\/revisions"}],"wp:attachment":[{"href":"http:\/\/hesiwei.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hesiwei.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=777"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hesiwei.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}