{"id":244,"date":"2026-08-01T15:40:43","date_gmt":"2026-08-01T07:40:43","guid":{"rendered":"https:\/\/www.idcy.com\/help\/news\/10244.html"},"modified":"2026-08-01T15:40:43","modified_gmt":"2026-08-01T07:40:43","slug":"wordpress-%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%83%a8%e7%bd%b2%e4%b8%8e%e4%b8%8a%e7%ba%bf%e6%a3%80%e6%9f%a5%e6%b8%85%e5%8d%95%ef%bc%9a%e4%bb%8e%e7%8e%af%e5%a2%83%e5%87%86%e5%a4%87%e5%88%b0%e5%ae%89%e5%85%a8","status":"publish","type":"post","link":"https:\/\/www.idcy.com\/help\/docs\/10244.html","title":{"rendered":"WordPress \u670d\u52a1\u5668\u90e8\u7f72\u4e0e\u4e0a\u7ebf\u68c0\u67e5\u6e05\u5355\uff1a\u4ece\u73af\u5883\u51c6\u5907\u5230\u5b89\u5168\u52a0\u56fa"},"content":{"rendered":"<p>WordPress \u662f\u5e7f\u6cdb\u4f7f\u7528\u7684\u5f00\u6e90\u5efa\u7ad9\u7cfb\u7edf\u3002\u5728\u4e91\u670d\u52a1\u5668\u4e0a\u81ea\u5efa\u73af\u5883\u65f6\uff0c\u5b8c\u6574\u53ef\u91cd\u590d\u7684\u90e8\u7f72\u6d41\u7a0b\u6bd4\u4e00\u952e\u5b89\u88c5\u66f4\u91cd\u8981\u3002\u672c\u6587\u4ee5 Nginx\/PHP\/MySQL \u7ec4\u5408\u4e3a\u4f8b\uff0c\u7ed9\u51fa\u4e00\u4efd<strong>\u53ef\u9a8c\u8bc1\u3001\u53ef\u56de\u6eda<\/strong>\u7684 WordPress \u90e8\u7f72\u6559\u7a0b\uff0c\u60a8\u53ef\u6309\u5b9e\u9645\u73af\u5883\u5fae\u8c03\u7248\u672c\u548c\u8def\u5f84\u3002<\/p>\n<h2>\u9002\u7528\u73af\u5883\u4e0e\u7248\u672c<\/h2>\n<p>\u672c\u6587\u57fa\u4e8e\u4ee5\u4e0b\u8f6f\u4ef6\u7248\u672c\u7f16\u5199\uff1a<\/p>\n<ul>\n<li>\u64cd\u4f5c\u7cfb\u7edf\uff1aUbuntu 22.04\/24.04 LTS\u3001Debian 12\u3001Rocky Linux 9\uff1b<\/li>\n<li>Web \u670d\u52a1\uff1aNginx 1.24+ \u6216 Apache 2.4+\uff1b<\/li>\n<li>PHP\uff1a8.1 \u6216 8.2\uff1b<\/li>\n<li>\u6570\u636e\u5e93\uff1aMySQL 8.0 \u6216 MariaDB 10.11+\u3002<\/li>\n<\/ul>\n<p>\u8bf7\u4ee5 WordPress \u5b98\u65b9\u6587\u6863\u4e3a\u51c6\u786e\u8ba4\u6700\u65b0\u517c\u5bb9\u7248\u672c\u3002\u672c\u6587\u547d\u4ee4\u5df2\u5728\u975e\u751f\u4ea7\u73af\u5883\u9a8c\u8bc1\uff0c\u90e8\u7f72\u524d\u987b\u5148\u5728\u6d4b\u8bd5\u673a\u6267\u884c\u3002<\/p>\n<h2>\u64cd\u4f5c\u524d\u51c6\u5907<\/h2>\n<p>\u5f00\u59cb\u524d\u786e\u4fdd\u5df2\u6709\u5907\u4efd\u6216\u56de\u6eda\u624b\u6bb5\uff1a<\/p>\n<ul>\n<li>\u4e91\u670d\u52a1\u5668\u5feb\u7167\uff0c\u63a8\u8350\u901a\u8fc7\u63a7\u5236\u53f0\u521b\u5efa\u5b9e\u4f8b\u5feb\u7167\uff1b<\/li>\n<li>\u5df2\u6709\u7ad9\u70b9\u7684\u6570\u636e\u5e93\u548c Web \u6839\u76ee\u5f55\u5907\u4efd\uff08mysqldump \u5bfc\u51fa\u6570\u636e\u5e93\uff0ctar \u6253\u5305 \/var\/www\uff09\uff1b<\/li>\n<li>\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u524d\u5907\u4efd\u539f\u59cb\u6587\u4ef6\uff0c\u5982 <code>cp \/etc\/nginx\/nginx.conf \/etc\/nginx\/nginx.conf.bak-$(date +%F)<\/code>\u3002<\/li>\n<\/ul>\n<h2>\u7b2c\u4e00\u6b65\uff1a\u57fa\u7840\u73af\u5883\u5b89\u88c5<\/h2>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade -y\nsudo apt install nginx mysql-server php8.1-fpm php8.1-mysql php8.1-xml php8.1-gd php8.1-curl php8.1-mbstring php8.1-zip -y<\/code><\/pre>\n<p>\u9a8c\u8bc1\u5404\u670d\u52a1\u5df2\u542f\u52a8\uff1a<code>nginx -v<\/code>\u3001<code>php -v<\/code> \u548c <code>mysql --version<\/code>\u3002<\/p>\n<h2>\u7b2c\u4e8c\u6b65\uff1a\u6570\u636e\u5e93\u914d\u7f6e<\/h2>\n<p>\u521b\u5efa\u4e13\u7528\u6570\u636e\u5e93\u548c\u7528\u6237\uff0c\u4e0d\u8981\u4f7f\u7528 root\uff1a<\/p>\n<pre><code>sudo mysql -u root<\/code><\/pre>\n<p>\u6267\u884c\uff1a<\/p>\n<pre><code>CREATE DATABASE wordpress CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;\nCREATE USER 'wpuser'@'localhost' IDENTIFIED BY '\u5f3a\u5bc6\u7801';\nGRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';\nFLUSH PRIVILEGES;\nEXIT;<\/code><\/pre>\n<p>\u8bb0\u5f55\u6570\u636e\u5e93\u540d\u3001\u7528\u6237\u540d\u548c\u5bc6\u7801\u4f9b\u540e\u7eed\u914d\u7f6e\u4f7f\u7528\u3002<\/p>\n<h2>\u7b2c\u4e09\u6b65\uff1a\u4e0b\u8f7d\u5e76\u914d\u7f6e WordPress<\/h2>\n<pre><code>cd \/var\/www\nsudo wget https:\/\/wordpress.org\/latest.tar.gz\nsudo tar -xzf latest.tar.gz\nsudo chown -R www-data:www-data wordpress\nsudo cp wordpress\/wp-config-sample.php wordpress\/wp-config.php<\/code><\/pre>\n<p>\u7f16\u8f91 <code>wp-config.php<\/code>\uff0c\u586b\u5165\u6570\u636e\u5e93\u4fe1\u606f\uff0c\u5e76\u4ece <a href=\"https:\/\/api.wordpress.org\/secret-key\/1.1\/salt\/\" rel=\"nofollow noopener\" target=\"_blank\">WordPress \u5b98\u65b9 API<\/a> \u83b7\u53d6\u76d0\u503c\u66ff\u6362\u5bf9\u5e94\u5e38\u91cf\u3002<\/p>\n<h2>\u7b2c\u56db\u6b65\uff1aNginx \u7ad9\u70b9\u914d\u7f6e<\/h2>\n<pre><code>server {\n    listen 80;\n    server_name your-domain.com;\n    root \/var\/www\/wordpress;\n    index index.php index.html index.htm;\n\n    location \/ {\n        try_files $uri $uri\/ \/index.php?$args;\n    }\n\n    location ~ \\.php$ {\n        include snippets\/fastcgi-php.conf;\n        fastcgi_pass unix:\/var\/run\/php\/php8.1-fpm.sock;\n    }\n\n    location ~ \/\\.ht {\n        deny all;\n    }\n}<\/code><\/pre>\n<p>\u6d4b\u8bd5\u5e76\u91cd\u8f7d\uff1a<code>sudo nginx -t &amp;&amp; sudo systemctl reload nginx<\/code>\u3002<\/p>\n<h2>\u7b2c\u4e94\u6b65\uff1a\u6743\u9650\u4e0e\u5b89\u5168\u52a0\u56fa<\/h2>\n<ul>\n<li>\u6587\u4ef6\u6743\u9650 644\uff0c\u76ee\u5f55 755\uff0cwp-config.php \u8bbe\u4e3a 600\uff1b<\/li>\n<li>\u7981\u7528\u4e3b\u9898\u548c\u63d2\u4ef6\u7f16\u8f91\u5668\uff1a\u5728 wp-config.php \u6dfb\u52a0 <code>define('DISALLOW_FILE_EDIT', true);<\/code>\uff1b<\/li>\n<li>\u542f\u7528\u9632\u706b\u5899\uff08\u5982 ufw\uff09\uff0c\u4ec5\u653e\u884c 80\/443 \u7aef\u53e3\u53ca\u7ba1\u7406 IP \u7684 22 \u7aef\u53e3\u3002<\/li>\n<\/ul>\n<h2>\u7b2c\u516d\u6b65\uff1a\u4e0a\u7ebf\u68c0\u67e5<\/h2>\n<p>\u8bbf\u95ee\u57df\u540d\u8fdb\u5165\u5b89\u88c5\u754c\u9762\uff0c\u8bbe\u7f6e\u7ad9\u70b9\u4fe1\u606f\u548c\u7ba1\u7406\u5458\u8d26\u6237\u3002\u767b\u5f55\u540e\u53f0\u9a8c\u8bc1\uff1a\u4eea\u8868\u76d8\u65e0\u62a5\u9519\uff0c\u4e3b\u9898\u548c\u63d2\u4ef6\u529f\u80fd\u6b63\u5e38\uff0c\u56fa\u5b9a\u94fe\u63a5\u5207\u6362\u4e3a\u300c\u6587\u7ae0\u540d\u300d\u540e\u793a\u4f8b\u9875\u9762\u53ef\u6b63\u5e38\u8bbf\u95ee\u3002\u82e5\u9a8c\u8bc1\u5931\u8d25\uff0c\u4ece\u5feb\u7167\u6062\u590d\u6216\u8fd8\u539f\u914d\u7f6e\u6587\u4ef6\u5907\u4efd\u5e76\u6e05\u7406\u76f8\u5173\u76ee\u5f55\u4e0e\u6570\u636e\u5e93\u3002<\/p>\n<h2>\u6027\u80fd\u4f18\u5316\u4e0e\u670d\u52a1\u5668\u9009\u578b<\/h2>\n<p>WordPress \u54cd\u5e94\u901f\u5ea6\u4f9d\u8d56\u670d\u52a1\u5668 I\/O \u548c\u7f51\u7edc\u3002\u5efa\u8bae\u9009\u7528 SSD \u6216 NVMe \u5b58\u50a8\uff0c\u4fdd\u969c CPU \u548c\u5185\u5b58\u4ee5\u652f\u6491\u5e76\u53d1\u548c\u7f13\u5b58\uff0c\u4f18\u8d28\u7ebf\u8def\u53ef\u63d0\u5347\u9875\u9762\u6253\u5f00\u901f\u5ea6\u3002\u4ebf\u8fbe\u7f51\u7edc\u4e91\u670d\u52a1\u5668\u8986\u76d6\u591a\u79cd\u914d\u7f6e\uff0c\u66f4\u591a\u90e8\u7f72\u6307\u5f15\u53ef\u67e5\u9605 <a href=\"https:\/\/www.idcy.com\/help\/?help_category=tech-docs\" title=\"WordPress\u670d\u52a1\u5668\u90e8\u7f72\u6559\u7a0b\" class=\"idcy-auto-link\">WordPress\u670d\u52a1\u5668\u90e8\u7f72\u6559\u7a0b<\/a>\uff0c\u5185\u5bb9\u4f1a\u7ed3\u5408\u6700\u65b0\u73af\u5883\u6301\u7eed\u66f4\u65b0\u3002<\/p>\n<h2>\u5e38\u89c1\u95ee\u9898<\/h2>\n<p><strong>Q\uff1a\u5982\u4f55\u5b89\u5168\u56de\u6eda\u7cfb\u7edf\u6216\u8f6f\u4ef6\u5305\u53d8\u66f4\uff1f<\/strong>\u63a8\u8350\u4f7f\u7528\u4e91\u670d\u52a1\u5668\u5feb\u7167\u6062\u590d\uff1b\u82e5\u65e0\u5feb\u7167\uff0c\u5219\u9010\u4e00\u8fd8\u539f\u5907\u4efd\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5e76\u67e5\u9605 <code>\/var\/log\/apt\/history.log<\/code> \u6216 <code>dnf history<\/code> \u64a4\u6d88\u8f6f\u4ef6\u5305\u64cd\u4f5c\u3002<\/p>\n<p><strong>Q\uff1aNginx \u914d\u7f6e\u4e2d fastcgi_pass \u8def\u5f84\u4e0d\u5339\u914d\u600e\u4e48\u529e\uff1f<\/strong>\u68c0\u67e5 PHP-FPM \u6c60\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684 <code>listen<\/code> \u53c2\u6570\uff0c\u4fee\u6539\u4e3a\u5b9e\u9645\u7684 socket \u6216 TCP \u7aef\u53e3\u540e\u91cd\u8f7d\u670d\u52a1\u3002<\/p>\n<p><strong>Q\uff1a\u8be5\u6559\u7a0b\u662f\u5426\u9002\u7528\u4e8e\u4e0d\u540c\u5730\u57df\u7684\u4e91\u670d\u52a1\u5668\uff1f<\/strong>\u9002\u7528\uff0c\u6b65\u9aa4\u4e0d\u4f9d\u8d56\u7279\u5b9a\u5730\u57df\u3002\u53ef\u6839\u636e\u7528\u6237\u4f4d\u7f6e\u9009\u62e9\u6570\u636e\u4e2d\u5fc3\u4ee5\u964d\u4f4e\u5ef6\u8fdf\u3002\u5982\u9047\u786c\u4ef6\u6216\u7f51\u7edc\u76f8\u5173\u95ee\u9898\uff0c\u53ef\u501f\u52a9 <a href=\"https:\/\/www.idcy.com\/about\/\" title=\"\u4ebf\u8fbe\u7f51\u7edc\uff08IDCY GLOBAL\uff09\" class=\"idcy-auto-link\">\u4ebf\u8fbe\u7f51\u7edc\uff08IDCY GLOBAL\uff09<\/a> \u6d4b\u8bd5\u65b9\u6848\uff0c\u9009\u62e9\u66f4\u5408\u9002\u7684\u670d\u52a1\u5668\u73af\u5883\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ece\u96f6\u5f00\u59cb\u5728\u4e91\u670d\u52a1\u5668\u4e0a\u90e8\u7f72WordPress\uff0c\u6db5\u76d6\u8f6f\u4ef6\u7248\u672c\u68c0\u67e5\u3001\u914d\u7f6e\u6587\u4ef6\u4fee\u6539\u3001\u6743\u9650\u8bbe\u7f6e\u548c\u4e0a\u7ebf\u524d\u5b89\u5168\u9a8c\u8bc1\u3002\u6bcf\u4e00\u6b65\u5747\u9644\u5e26\u547d\u4ee4\u7528\u9014\u4e0e\u56de\u6eda\u65b9\u6cd5\uff0c\u907f\u514d\u76f4\u63a5\u6e05\u7a7a\u6570\u636e\u7684\u5371\u9669\u64cd\u4f5c\u3002\u7ed3\u5408\u4ebf\u8fbe\u7f51\u7edc\u4e91\u670d\u52a1\u5668\u7684\u7075\u6d3b\u9009\u914d\uff0c\u53ef\u4e3aWordPress\u63d0\u4f9b\u66f4\u5feb\u7684\u9875\u9762\u52a0\u8f7d\u548c\u66f4\u7a33\u5b9a\u7684\u8fd0\u884c\u73af\u5883\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","rank_math_focus_keyword":"WordPress\u670d\u52a1\u5668\u90e8\u7f72\u6559\u7a0b, \u4ebf\u8fbe\u7f51\u7edc\uff08IDCY GLOBAL\uff09"},"categories":[6],"tags":[],"class_list":["post-244","post","type-post","status-publish","format-standard","hentry","category-tech-docs"],"_links":{"self":[{"href":"https:\/\/www.idcy.com\/index.php?rest_route=\/wp\/v2\/posts\/244","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.idcy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.idcy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.idcy.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.idcy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=244"}],"version-history":[{"count":0,"href":"https:\/\/www.idcy.com\/index.php?rest_route=\/wp\/v2\/posts\/244\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.idcy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.idcy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.idcy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}