{"id":101,"date":"2022-12-06T15:30:45","date_gmt":"2022-12-06T15:30:45","guid":{"rendered":"https:\/\/chenyl.one\/?p=101"},"modified":"2024-04-13T20:16:59","modified_gmt":"2024-04-13T12:16:59","slug":"wordpress%e5%ae%89%e8%a3%85centos7-%e4%bb%8e%e8%a3%b8%e6%9c%ba%e5%88%b0%e8%ae%bf%e9%97%ae%e6%88%90%e5%8a%9f","status":"publish","type":"post","link":"https:\/\/chenyl.fun\/?p=101","title":{"rendered":"wordpress\u5b89\u88c5(centos7)-\u4ece\u88f8\u673a\u5230\u8bbf\u95ee\u6210\u529f"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/chenyl.one\/wp-content\/uploads\/2022\/12\/wordpress-logo-wallpaper-62785-64776-hd-wallpapers-1024x576.png\" alt=\"\" class=\"wp-image-102\" srcset=\"https:\/\/word-press-chenyl-20240330.oss-cn-zhangjiakou.aliyuncs.com\/wp-content\/uploads\/2022\/12\/wordpress-logo-wallpaper-62785-64776-hd-wallpapers-1024x576.png 1024w, https:\/\/word-press-chenyl-20240330.oss-cn-zhangjiakou.aliyuncs.com\/wp-content\/uploads\/2022\/12\/wordpress-logo-wallpaper-62785-64776-hd-wallpapers-300x169.png 300w, https:\/\/word-press-chenyl-20240330.oss-cn-zhangjiakou.aliyuncs.com\/wp-content\/uploads\/2022\/12\/wordpress-logo-wallpaper-62785-64776-hd-wallpapers-768x432.png 768w, https:\/\/word-press-chenyl-20240330.oss-cn-zhangjiakou.aliyuncs.com\/wp-content\/uploads\/2022\/12\/wordpress-logo-wallpaper-62785-64776-hd-wallpapers-1536x864.png 1536w, https:\/\/word-press-chenyl-20240330.oss-cn-zhangjiakou.aliyuncs.com\/wp-content\/uploads\/2022\/12\/wordpress-logo-wallpaper-62785-64776-hd-wallpapers.png 1600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u5e9f\u8bdd\u4e0d\u591a,\u76f4\u63a5\u8fdb\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305:<br>\u56fd\u5185\u7ad9<br>https:\/\/cn.wordpress.org<br>\u56fd\u9645\u7ad9<br>https:\/\/wordpress.org\/<br>wordpress\u6700\u65b0\u7248\u4e0b\u8f7d\u94fe\u63a5<br>https:\/\/cn.wordpress.org\/latest-zh_CN.tar.gz<br>https:\/\/wordpress.org\/latest.zip<br>wordpress\u6700\u65b0\u7248(6.1.1)\u8fd0\u884c\u9700\u6c42<br>PHP 7.4\u6216\u66f4\u9ad8\u7248\u672c\uff1b\u6570\u636e\u5e93\u8f6f\u4ef6\u53ef\u91c7\u7528MySQL 5.7\u6216\u66f4\u9ad8\u7248\u672c\uff0c\u4e5f\u53ef\u91c7\u7528MariaDB 10.3\u6216\u66f4\u9ad8\u7248\u672c<br>\u4e0b\u6765\u5f00\u59cb\u5404\u79cd\u5b89\u88c5:<\/p>\n\n\n\n<p><strong>0.\u5982\u679c\u662f\u56fd\u5185\u673a\u5668,\u8bb0\u5f97\u5148\u6362\u6e90;<\/strong><\/p>\n\n\n\n<p>1.<strong>php\u7684\u5b89\u88c5\u548c\u914d\u7f6e<\/strong><br>a) \u4ee5\u6dfb\u52a0\u6240\u9700\u7684\u5b58\u50a8\u5e93<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">sudo yum install epel-release<\/code><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">sudo yum -y install https:\/\/rpms.remirepo.net\/enterprise\/remi-release-7.rpm<\/code><br>b) \u5b89\u88c5php7.4<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">sudo yum -y install yum-utils<\/code><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">sudo yum-config-manager --enable remi-php74<\/code><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">sudo yum install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json php-redis<\/code><br>\u67e5\u770b\u7248\u672c<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">php74 \u2013v<\/code><br>\u67e5\u770b\u5df2\u7ecf\u5b89\u88c5\u7684\u6a21\u5757<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">php \u2013modules<\/code><br>php\u7684\u5b89\u88c5\u5230\u8fd9\u91cc\u5c31\u5b8c\u6210\u4e86<br>\u542f\u52a8\u670d\u52a1<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">systemctl start php74-php-fpm<\/code><\/p>\n\n\n\n<p class=\"has-text-align-left\">2.<strong>mysql\u7684\u5b89\u88c5\u548c\u914d\u7f6e<\/strong><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">yum install mysql<\/code><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">yum install mariadb-server mariadb<\/code>(CentOS 7 \u7248\u672c\u5c06MySQL\u6570\u636e\u5e93\u8f6f\u4ef6\u5df2\u4ece\u9ed8\u8ba4\u7684\u7a0b\u5e8f\u5217\u8868\u4e2d\u79fb\u9664,\u4ee5mariadb\u4ee3\u66ff)<br>\u5b89\u88c5\u5b8c\u6210\u4e4b\u540e<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">mysql \u2013h localhost \u2013u root<\/code><br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">use mysql;<\/code><br>\u7136\u540e<code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">select VERSION();<\/code><br>\u5373\u53ef\u67e5\u770b\u7248\u672c,\u6211\u8fd9\u91cc\u5b89\u88c5\u4e86\u9ed8\u8ba4\u7684\u7248\u672c,\u8fd0\u884cwordpress\u65f6\u76ee\u524d\u6ca1\u6709\u53d1\u73b0\u4ec0\u4e48\u95ee\u9898;<br>\u521b\u5efa\u6570\u636e\u5e93:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">create database word_press default character set utf8mb4 collate utf8mb4_unicode_ci<\/code><br>\u521b\u5efa\u7528\u6237:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">create user the_user_name identified by \u2018thisispassword';<\/code><br>\u7528\u6237\u6388\u6743:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">grant all privileges on word_press.* to ' the_user_name '@'%' identified by ' thisispassword';<\/code><\/p>\n\n\n\n<p class=\"has-text-align-left\"><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">flush privileges;<\/code><\/p>\n\n\n\n<p>3.<strong>nginx\u7684\u5b89\u88c5\u548c\u914d\u7f6e<\/strong><br>a) \u5b89\u88c5nginx<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">yum install -y nginx<\/code><br>b) \u7f16\u8f91\u914d\u7f6e<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">vim \/etc\/nginx\/nginx.conf<\/code><br>\u5728http\u5185\u6dfb\u52a0\u4e00\u4e2aserver<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">server {\n\t\t\t listen 80;\n\t\t\t # listen [::]:80;\n\t\t\t server_name '\u4f60\u7684\u57df\u540d';\n\t\t\t # \u6ca1\u57df\u540d\u7528 ~^(.+)$ \u901a\u914d\u6240\u6709\u8bbf\u95ee\u5f62\u5f0f\n\t\t\t # server_name localhost;\n\t\t\t # root \/usr\/share\/nginx\/html;\n\t\t\t # Load configuration files for the default server block.\n\t\t\t include \/etc\/nginx\/default.d\/*.conf;\n\t\t\t \n\t\t\t\t location \/ {\n\t\t\t\t root \/etc\/nginx\/websites\/word_press;\n\t\t\t\t index index.php index.html index.htm;\n\t\t\t\t }\n\t\t\t \n\t\t\t\t location ~ \\.php$ {\n\t\t\t\t  root \/etc\/nginx\/websites\/word_press;\n\t\t\t\t index index.php;\n\t\t\t\t fastcgi_pass 127.0.0.1:9000;\n\t\t\t\t fastcgi_index index.php;\n\t\t\t\t fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n\t\t\t\t  include fastcgi_params;\n\t\t\t\t }\n\t\t\t \n\t\t\t\t error_page 404 \/404.html;\n\t\t\t\t location = \/404.html {\n\t\t\t\t }\n\t\t\t \n\t\t\t\t error_page 500 502 503 504 \/50x.html;\n\t\t\t\t location = \/50x.html {\n\t\t\t\t }\n\t\t\t}<\/pre>\n\n\n\n<p>4.<strong>\u9632\u706b\u5899\u548cselinux\u7684\u7aef\u53e3\u5f00\u653e<\/strong><br>a) \u5f00\u653e80<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">firewall-cmd --zone=public --add-port=80\/tcp \u2013permanent<\/code><br>\u91cd\u65b0\u8f7d\u5165<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">firewall-cmd \u2013reload<\/code><br>\u67e5\u770b<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">firewall-cmd --zone=public --list-ports <\/code><\/p>\n\n\n\n<p>b) selinux \u6bd4\u8f83\u590d\u6742,\u8fd9\u91cc\u76f4\u63a5\u9009\u62e9\u5bbd\u5bb9\u6a21\u5f0f<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">setenforce 0<\/code><br>\u5373\u53ef\u653e\u884c<br>\u60f3\u7814\u7a76\u7684\u53c2\u89c1: http:\/\/c.biancheng.net\/view\/3921.html<\/p>\n\n\n\n<p>5.<strong>\u542f\u52a8wordpress<\/strong><br>a) \u89e3\u538b\u4e0b\u8f7d\u597d\u7684\u538b\u7f29\u5305<br>tar.gz\u5305\u7684\u547d\u4ee4:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">tar \u2013zxvf yourpac.tar.gz<\/code><br>zip\u5305\u89e3\u538b\u547d\u4ee4:<br><code data-enlighter-language=\"generic\" class=\"EnlighterJSRAW\">unzip yourpac.zip<\/code><br>\u6ce8\u610f\u89e3\u538b\u76ee\u5f55\u4e0enginx\u91cc\u7684\u76ee\u5f55\u5bf9\u5e94 b) \u5982\u679c\u4f60\u77e5\u9053mysql\u7684\u914d\u7f6e,\u7f16\u8f91wordpress\u89e3\u538b\u76ee\u5f55\u4e0b\u7684wp-config.php<br>\u6839\u636e\u5bf9\u5e94\u7684\u8bf4\u660e\u8fdb\u884c\u586b\u5199,\u6ce8\u610fDB_COLLATE \u8fd9\u4e2a\u4e0d\u8981\u586b\u5199 \u5982\u679c\u4e0d\u77e5\u9053\u600e\u4e48\u586b\u5199:<br>\u76f4\u63a5\u5728\u6d4f\u89c8\u5668\u8bbf\u95ee \u4f60\u7684\u57df\u540d\u6216\u8005ip\/wp-admin\/install.php \u6839\u636e\u63d0\u793a\u8fdb\u884c\u5b89\u88c5,\u5b89\u88c5\u5b8c\u6210\u540e\u4f1a\u5c55\u793a\u767b\u5f55\u9875\u9762,\u6b64\u65f6\u6240\u6709\u5b89\u88c5\u5de5\u4f5c\u5c31\u5df2\u7ecf\u5b8c\u6210\u4e86,Enjoy!<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/chenyl.one\/wp-content\/uploads\/2022\/12\/WordPress-1457709817-0-0-1024x579.png\" alt=\"\" class=\"wp-image-103\"\/><\/figure>\n\n\n\n<p>\u82f1\u6587\u7248guide\u9875:<br><a href=\"https:\/\/wordpress.org\/support\/article\/how-to-install-wordpress\/\">How to install WordPress \u2013 WordPress.org Forums<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5e9f\u8bdd\u4e0d\u591a,\u76f4\u63a5\u8fdb\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305:\u56fd\u5185\u7ad9https:\/\/cn.wordpress.org\u56fd\u9645\u7ad9https:\/\/w [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[31],"_links":{"self":[{"href":"https:\/\/chenyl.fun\/index.php?rest_route=\/wp\/v2\/posts\/101"}],"collection":[{"href":"https:\/\/chenyl.fun\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chenyl.fun\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chenyl.fun\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chenyl.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=101"}],"version-history":[{"count":4,"href":"https:\/\/chenyl.fun\/index.php?rest_route=\/wp\/v2\/posts\/101\/revisions"}],"predecessor-version":[{"id":107,"href":"https:\/\/chenyl.fun\/index.php?rest_route=\/wp\/v2\/posts\/101\/revisions\/107"}],"wp:attachment":[{"href":"https:\/\/chenyl.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chenyl.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chenyl.fun\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}