{"id":24,"date":"2021-12-25T05:56:30","date_gmt":"2021-12-24T21:56:30","guid":{"rendered":"https:\/\/blog.messyghost.net\/?p=24"},"modified":"2022-07-02T23:18:24","modified_gmt":"2022-07-02T15:18:24","slug":"wordpress%e9%83%a8%e7%bd%b2%e8%b8%a9%e5%9d%91","status":"publish","type":"post","link":"https:\/\/blog.messyghost.net\/?p=24","title":{"rendered":"WordPress\u90e8\u7f72\u8e29\u5751"},"content":{"rendered":"\n<p>\u4ee5\u524d\u66fe\u7ecf\u8bf4\u8fc7\u8981\u81ea\u5df1\u5f00\u53d1\u4e00\u4e2a\u535a\u5ba2\u670d\u52a1\u7a0b\u5e8f\uff0c\u540e\u6765\u786e\u5b9e\u505a\u51fa\u4e86\u4e00\u4e2a\u52c9\u5f3a\u80fd\u7528+\u80fd\u770b\u7684\u535a\u5ba2\u7a0b\u5e8f\uff0c\u4e0d\u8fc7\u6240\u6709\u535a\u6587\u90fd\u662f\u4ee5JSON\u5f62\u5f0f\u5b58\u50a8\u7684\u3001\u81ea\u5df1\u80e1\u4e71\u5199\u4e2aAccess Token\u7684\u6a21\u5757\uff0c\u751a\u81f3\u6ca1\u6709\u63a5\u5165\u6570\u636e\u5e93\uff0c\u73b0\u5728\u60f3\u6765\u5f53\u521d\u8fd8\u662f\u592a\u5929\u771f\u2026\u2026<\/p>\n\n\n\n<p>\u540e\u6765\u4e70\u4e86\u4e00\u53f0\u670d\u52a1\u5668\u548c\u51e0\u4e2a\u57df\u540d\uff0c\u8fde\u7740\u90e8\u7f72\u4e86\u51e0\u4e2a\u670d\u52a1\uff0c\u60f3\u7740\u987a\u4fbf\u505a\u4e2a\u535a\u5ba2\uff0c\u4fbf\u6253\u7b97\u628aWordPress\u4e5f\u6574\u4e0a\u6765\u3002\u867d\u7136\u6ca1\u5b66\u8fc7\u4e16\u754c\u4e0a\u6700\u597d\u7684\u8bed\u8a00\uff0c\u4f46\u662f\u6211\u7684\u76ee\u7684\u662f\u7528\uff0c\u53c8\u4e0d\u662f\u5199XD\u3002<\/p>\n\n\n\n<p>\u4e00\u5f00\u59cb\u8fd8\u633a\u987a\u5229\uff0c\u76f4\u5230\u540e\u6765\u65e0\u6cd5\u81ea\u52a8\u66f4\u65b0\u535a\u5ba2\u7a0b\u5e8f\uff0c\u8fd8\u770b\u5230\u540e\u53f0\u63d0\u793aPHP\u7248\u672c\u8fc7\u4f4e\uff0c\u4fbf\u89c9\u5f97\u5148\u628aPHP\u66f4\u65b0\u4e86\u597d\u3002\u4f46\u662f\u5305\u7ba1\u7406\u5668\u5e76\u6ca1\u63d0\u4f9b\u65b0\u7248\u7684PHP\uff0c\u6211\u53ea\u597d\u81ea\u5df1\u624b\u52a8\u7f16\u8bd1\u3002\u4e00\u5f00\u59cb\u8fd8\u7b97\u987a\u5229\uff0c\u76f4\u5230\u89c1\u5230\u4e86\u672a\u5b9a\u4e49mysql_connect()\u7684\u9519\u8bef\u2026\u2026\u597d\u5427\uff0c\u6bd5\u7adf\u7528\u5305\u7ba1\u7406\u5668\u81ea\u5e26\u7684PHP\u4e5f\u8981\u624b\u52a8\u5b89\u88c5php-mysql\u7684\u5305\u3002\u4e00\u987f\u64cd\u4f5c\u731b\u5982\u864e\u540e\uff0c\u8fd8\u662f\u9519\u8bef\u2026\u2026\uff08\u53e6\u6ce8\uff1a\u8fd9\u624b\u52a8\u7f16\u8bd1PHP\u597d\u9ebb\u70e6orz\uff0c\u4ec0\u4e48\u62d3\u5c55\u90fd\u9700\u8981\u81ea\u5df1\u58f0\u660e\u5199\u4e0a\u53bb\uff0c\u5305\u7ba1\u7406\u5668\u91cc\u7684PHP\u5f88\u591a\u62d3\u5c55\u90fd\u81ea\u5e26\u4e86\uff0c\u4e2d\u9014\u670d\u52a1\u5668\u8fd8\u7206\u5185\u5b58\u4e86\uff09<\/p>\n\n\n\n<p>\u540e\u6765\uff0c\u53d1\u73b0\u624b\u52a8\u7f16\u8bd1\u7248\u672c\u7684PHP\u8981\u4f7f\u7528MySQL\u5fc5\u987b\u8981\u5728\u7f16\u8bd1\u524d\u5bf9configure\u6307\u5b9a<code>--with-mysqli --with-pdo-mysql --enable-mysqlnd<\/code>\u4e09\u4e2a\u9009\u9879\u3002\uff08\u8fd8\u6709\u5f88\u591a\u5176\u4ed6\u7684\u5e93\u9700\u8981\u6307\u5b9a\uff0c\u4e0d\u6b62MySQL\u3002\u6211\u6307\u5b9a\u5e93\u65f6\u6709\u4e00\u4e9b\u8fd8\u8981\u4e0b\u8f7d\u5f00\u53d1\u5305\uff0c\u70b9\u540d\u6279\u8bc4oniguruma\u7684\u5f00\u53d1\u5305\u5c45\u7136\u5728\u5305\u7ba1\u7406\u5668\u9ed8\u8ba4\u6e90\u91cc\u6ca1\u6709\uff0c\u4e0b\u8f7d\u6e90\u7801\u540e\u5b89\u88c5\u7684\u4e5f\u4e0d\u662f\u5f00\u53d1\u5305\/\u7f16\u8bd1\u5b89\u88c5\u7684\u8bdd\u5e94\u8be5\u672c\u6765\u5c31\u4e0d\u4f1a\u662f\u5f00\u53d1\u5305\u5427233\uff09\u800c\u4e14\u81ea\u52a8\u751f\u6210\u7684\u7684\u914d\u7f6e\u6587\u4ef6\u4e0d\u592a\u4e00\u6837\uff0c\u8981\u914d\u7f6e\u4e00\u4e0bfpm user\u548cgroup\uff0c\u4ee5\u53casocket\u7684\u6587\u4ef6\u6743\u9650\u4e5f\u8981\u5904\u7406\u4e00\u4e0b\uff0c\u8fd9\u4e5f\u65e0\u4f24\u5927\u96c5\u2026\u2026\uff08\u53e6\u6ce8\uff1amysql_connect()\u9519\u8bef\u65f6\u7adf\u7136\u4f1a\u628a\u5bc6\u7801\u968f\u9519\u8bef\u4fe1\u606f\u4e5f\u4e00\u8d77\u6253\u5370\u51fa\u6765\u2026\u2026\u53ef\u80fd\u56e0\u4e3a\u6211\u7f3a\u5e93\u592a\u4e25\u91cd\u4e86\u5427\uff0c\u5176\u5b9e\u73b0\u5728\u4e5f\u8fd8\u7f3a\u4e00\u4e2a\u5e93\uff09<\/p>\n\n\n\n<p>\u53ef\u662f\uff0c\u7f16\u8bd1\u597d\u4e4b\u540e\u4f9d\u65e7\u65e0\u6cd5\u66f4\u65b0\u6587\u4ef6\uff08\u4e0d\u9002\u7528FTP\uff0c\u4e00\u5f00\u59cb\u6211\u8fd8\u7eb3\u95f7\uff1a\u4f60\u8fd9PHP\u4e0d\u662f\u8fd0\u884c\u5728\u670d\u52a1\u5668\u4e0a\u7684\u5417\uff0c\u600e\u4e48\u8fd8\u9700\u8981\u8fdc\u7a0b\u8fde\u63a5\u53bb\u66f4\u65b0\u6587\u4ef6\u554a\uff09\u5450\uff0cchown chmod\u4ec0\u4e48\u7684\u4e5f\u4e0d\u7ba1\u7528\uff0c\u4e00\u76f4\u82b1\u4e86\u51e0\u4e2a\u5c0f\u65f6\uff0c\u8fde\u5207\u8bed\u8a00\u90fd\u8981\u4e0b\u8f7d\u4e00\u4e2a\u4e2d\u6587\u7248\u7684WordPress\u4ece\u91cc\u9762\u63d0\u53d6\u8bed\u8a00\u5305\u2026\u2026<\/p>\n\n\n\n<p>\u76f4\u5230\u540e\u6765\uff0c\u6211\u4eb2\u81ea\u5199\u4e86\u4e2a\u8c03\u7528mkdir()\u51fd\u6570\u7684php\u6587\u4ef6\uff0c\u63d0\u793a<code>Read-only filesystem<\/code>\u3002<\/p>\n\n\n\n<p>\u2026\u2026<\/p>\n\n\n\n<p>\u6ca1\u7406\u7531\u554a\uff0c\u6211\u8fd9\u6587\u4ef6\u7cfb\u7edf\u5206\u660e\u80fd\u5199\u3002<\/p>\n\n\n\n<p>\u2026\u2026<\/p>\n\n\n\n<p>\u968f\u540e\u6211\u628a\u89c6\u91ce\u4eceWordPress\u62d3\u5bbd\u5230php-fpm\u4e0a\uff0c\u518d\u6b21\u8c03\u7528\u641c\u7d22\u5f15\u64ce\uff0c\u770b\u5230<a href=\"https:\/\/www.jianshu.com\/p\/484f10816d34\" target=\"_blank\" rel=\"noreferrer noopener\">\u8fd9\u4e2a<\/a>\uff0c\u7adf\u7136\u662fsystemd\u7684\u9505\u2026\u2026\uff08ProtectSystem\uff09<\/p>\n\n\n\n<p>\u518d\u6b21\u4fee\u6539\uff0c<code>systemctl daemon-reload &amp;&amp; systemctl restart php-fpm<\/code>\uff0c\u95ee\u9898\u5df2\u7ecf\u89e3\u51b3\u3002<\/p>\n\n\n\n<p>\u5c0f\u63d2\u66f2\uff1a\u4e2d\u9014\u53d1\u73b0\u81ea\u5df1\u7684\u7684\u670d\u52a1\u5668\u88ab\u4eba\u7528SSH \u201cDDOS\u201d\u4e86\uff0c\u4f46\u662f\u8fde\u63a5\u9891\u7387\u90fd\u4e0d\u9ad8\u4e14\u90fd\u6765\u81ea\u540c\u4e00\u4e2aIP\uff0c\u76f4\u63a5\u7528\u9632\u706b\u5899\u89c4\u5219\u628a\u90a3\u4e2aIP\u7684\u8bf7\u6c42\u7ed9DROP\u5c31\u597d\u4e86\u3002<\/p>\n\n\n\n<p>\u4fee\u6539\uff1a\u522b\u7528CentOS\uff0c\u8981\u4e48\u7528Rocky Linux\u8981\u4e48\u7528Ubuntu\uff0c\u4e0d\u7136\u5c31\u4f1a\u50cf\u4e0a\u9762\u90a3\u6837\u6b7b\u5f97\u90a3\u4e48\u60e8\uff01\u6211\u5df2\u7ecf\u8f6cUbuntu\u4e86\uff0c\u65b0\u6765\u7684\u7528CentOS\u7684\u5feb\u8dd1\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u524d\u66fe\u7ecf\u8bf4\u8fc7\u8981\u81ea\u5df1\u5f00\u53d1\u4e00\u4e2a\u535a\u5ba2\u670d\u52a1\u7a0b\u5e8f\uff0c\u540e\u6765\u786e\u5b9e\u505a&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/blog.messyghost.net\/?p=24\">Continue reading<span class=\"screen-reader-text\">WordPress\u90e8\u7f72\u8e29\u5751<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,8],"tags":[],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-3","category-8","entry"],"_links":{"self":[{"href":"https:\/\/blog.messyghost.net\/index.php?rest_route=\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.messyghost.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.messyghost.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.messyghost.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.messyghost.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=24"}],"version-history":[{"count":6,"href":"https:\/\/blog.messyghost.net\/index.php?rest_route=\/wp\/v2\/posts\/24\/revisions"}],"predecessor-version":[{"id":135,"href":"https:\/\/blog.messyghost.net\/index.php?rest_route=\/wp\/v2\/posts\/24\/revisions\/135"}],"wp:attachment":[{"href":"https:\/\/blog.messyghost.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.messyghost.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.messyghost.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}