{"id":19,"date":"2021-01-22T17:52:55","date_gmt":"2021-01-22T09:52:55","guid":{"rendered":"http:\/\/192.168.3.2\/?p=19"},"modified":"2022-06-15T12:43:26","modified_gmt":"2022-06-15T04:43:26","slug":"linux%e5%8d%a1%e7%89%87%e8%ae%b0%e5%bd%95","status":"publish","type":"post","link":"https:\/\/blog.glab.online\/?p=19","title":{"rendered":"Quark N\u642d\u5efawordpress"},"content":{"rendered":"\n<p>Quanrk N\u521d\u8bc6\u955c\u50cf\u5b9e\u9645\u5df2\u7ecf\u5b89\u88c5\u4e86Nginx\uff0c\u6240\u4ee5\u6211\u4eec\u91c7\u7528Nginx+MySQL+PHP\u7684\u65b9\u5f0f\u3002<br><\/p>\n\n\n\n<p><strong>\u5b89\u88c5MySQL\u4ee5\u7ba1\u7406\u7ad9\u70b9\u6570\u636e<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install mysql-server<\/code><\/pre>\n\n\n\n<p>\u7cfb\u7edf\u5c06\u8981\u6c42\u60a8\u8f93\u5165root\uff08\u7ba1\u7406\uff09\u5bc6\u7801\uff0c\u4ee5\u4fbf\u5728MySQL\u7cfb\u7edf\u4e2d\u4f7f\u7528\u3002\u8bf7\u8bb0\u4f4f\u6b64\u5904\u8f93\u5165\u7684\u5bc6\u7801\u3002<\/p>\n\n\n\n<p><strong>\u5b89\u88c5PHP\u8fdb\u884c\u5904\u7406<\/strong><br>WordPress\u65b0\u7248\uff08\u5f53\u524d\u4e3a5.6\uff09\u5df2\u7ecf\u63a8\u8350\u91c7\u7528php7.4\uff0c\u4f46\u662fubuntu16.04\u9ed8\u8ba4\u6e90\u4e2d\u6ca1\u6709\u3002\u6211\u4eec\u5148\u6dfb\u52a0php7.4\u7684\u6e90\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt -y install software-properties-common\nsudo add-apt-repository ppa:ondrej\/php\nsudo apt-get update<\/code><\/pre>\n\n\n\n<p>\u6e90\u91cc\u9762\u5df2\u7ecf\u5305\u542bphp8.0\u7248\u672c\uff0c\u4f46\u662f\u5f53\u524dwordpress\u63d2\u4ef6\u652f\u6301\u4e0d\u597d\uff0c\u6211\u4eec\u5b89\u88c5php7.4\u7248\u672c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install php7.4-fpm php7.4-mysql\n<\/code><\/pre>\n\n\n\n<p><strong>\u914d\u7f6ePHP\u5904\u7406\u5668<\/strong><br>\u6211\u4eec\u73b0\u5728\u5df2\u7ecf\u5b89\u88c5\u4e86PHP\u7ec4\u4ef6\uff0c\u4f46\u662f\u6211\u4eec\u9700\u8981\u8fdb\u884c\u8f7b\u5fae\u7684\u914d\u7f6e\u66f4\u6539\u4ee5\u4f7f\u6211\u4eec\u7684\u8bbe\u7f6e\u66f4\u5b89\u5168\u3002<\/p>\n\n\n\n<p>php-fpm\u4f7f\u7528root\u6743\u9650\u6253\u5f00\u4e3b\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/etc\/php\/7.4\/fpm\/php.ini<\/code><\/pre>\n\n\n\n<p><br>\u5728\u6587\u4ef6\u4e2d\u5bfb\u627e\u7684\u662f\u8bbe\u7f6e\u7684\u53c2\u6570cgi.fix_pathinfo\uff0c\u5c06\u524d\u9762\u7684\u6ce8\u91ca; \u53bb\u6389\uff0c\u7136\u540e\u5c06\u9ed8\u8ba4\u8bbe\u7f6e\u201c1\u201d\u4fee\u6539\u4e3a&#8221;0&#8243;\u3002<\/p>\n\n\n\n<p>cgi.fix_pathinfo=0<\/p>\n\n\n\n<p>\u4fee\u6539\u8fd9\u91cc\u662f\u56e0\u4e3a\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38\u4e0d\u5b89\u5168\u7684\u8bbe\u7f6e\uff0c\u56e0\u4e3a\u5b83\u544a\u8bc9PHP\u5c1d\u8bd5\u6267\u884c\u5b83\u627e\u4e0d\u5230\u6240\u8bf7\u6c42\u7684PHP\u6587\u4ef6\u65f6\u53ef\u4ee5\u627e\u5230\u7684\u6700\u63a5\u8fd1\u7684\u6587\u4ef6\u3002\u8fd9\u57fa\u672c\u4e0a\u5141\u8bb8\u7528\u6237\u6267\u884c\u4e0d\u5e94\u8be5\u88ab\u5141\u8bb8\u6267\u884c\u7684\u811a\u672c\u7684\u65b9\u5f0f\u6765\u521b\u5efaPHP\u8bf7\u6c42\u3002<\/p>\n\n\n\n<p><strong>\u91cd\u542fPHP\u5904\u7406<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart php7.4-fpm<\/code><\/pre>\n\n\n\n<p><br><strong>\u914d\u7f6eNginx\u4ee5\u4f7f\u7528PHP\u5904\u7406\u5668<\/strong><br>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/etc\/nginx\/sites-available\/default<\/code><\/pre>\n\n\n\n<p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u6dfb\u52a0index.php\u4f5c\u4e3aindex\u6307\u4ee4\u7684\u7b2c\u4e00\u4e2a\u503c\uff0c\u4ee5\u4fbfindex.php\u5728\u8bf7\u6c42\u76ee\u5f55\u65f6\u53ef\u7528\u3002<br>\u6211\u4eec\u53ef\u4ee5\u4fee\u6539server_name\u6307\u4ee4\u4ee5\u6307\u5411\u6211\u4eec\u670d\u52a1\u5668\u7684\u57df\u540d\u6216\u516c\u5171IP\u5730\u5740\u3002<br>\u5bf9\u4e8e\u5b9e\u9645\u7684PHP\u5904\u7406\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5220\u9664PHP\u90e8\u5206\u524d\u9762\u7684\u6ce8\u91ca\u4e95\u53f7\uff08\uff03\uff09\u6765\u53d6\u6d88\u6ce8\u91ca\uff0c\u4ee5\u4fbf\u542f\u7528\u5904\u7406PHP\u8bf7\u6c42\u7684\u6587\u4ef6\u6bb5\u3002<br>\u518d\u5c06.htaccess\u90e8\u5206\u53d6\u6d88\u6ce8\u91ca<br>\u9ed8\u8ba4\u914d\u7f6e\u6700\u7ec8\u66f4\u6539\u6210\u5982\u4e0b\uff1a<\/p>\n\n\n\n<blockquote class=\"wp-block-quote has-text-align-left is-layout-flow wp-block-quote-is-layout-flow\"><p>server {<\/p><p>listen 80 default_server;<br>listen [::]:80 default_server;<\/p><p>root \/var\/www\/html;<\/p><p>#\u8fd9\u4e00\u884c\u4e2d\u6dfb\u52a0\u4e86index.php<br>index index.php index.html index.htm index.nginx-debian.html;<\/p><p>#\u6b64\u5904\u4fee\u6539\u4f60\u7684\u57df\u540d\uff0c\u5982\u679c\u6ca1\u6709\u5219\u4e0d\u9700\u8981\u4fee\u6539\u6e90\u6587\u4ef6<br>server_name server_domain_or_IP;<\/p><p>location \/ {<br>try_files $uri $uri\/ =404;<br>}<\/p><p>#\u4ee5\u4e0b\u6240\u6709\u5185\u5bb9\u9700\u8981\u6dfb\u52a0<br>location ~ \\.php$ {<br>include snippets\/fastcgi-php.conf;<br>fastcgi_pass unix:\/run\/php\/php7.0-fpm.sock;<br>}<\/p><p>location ~ \/\\.ht {<br>deny all;<br>}<br>#\u4ee5\u4e0a\u6240\u6709\u5185\u5bb9\u9700\u8981\u6dfb\u52a0<br>}<\/p><\/blockquote>\n\n\n\n<p>\u5b8c\u6210\u4e0a\u8ff0\u66f4\u6539\u540e\uff0c\u60a8\u53ef\u4ee5\u4fdd\u5b58\u5e76\u5173\u95ed\u8be5\u6587\u4ef6\u3002<\/p>\n\n\n\n<p>\u68c0\u67e5ng\u7684\u8bed\u6cd5\u9519\u8bef<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nginx -t<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u6ca1\u6709\u95ee\u9898\u91cd\u542fNginx<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl reload nginx<\/code><\/pre>\n\n\n\n<p><br><strong>\u521b\u5efaPHP\u6587\u4ef6\u4ee5\u6d4b\u8bd5\u914d\u7f6e\uff08\u53ef\u8df3\u8fc7\u6b64\u6b65\uff09<\/strong><br>\u6d4b\u8bd5Nginx\u662f\u5426\u53ef\u4ee5\u6b63\u786e\u5730\u5c06.php\u6587\u4ef6\u4f20\u9012\u7ed9\u6211\u4eec\u7684PHP\u5904\u7406\u5668\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5728\u6587\u6863\u6839\u76ee\u5f55\u4e2d\u521b\u5efa\u6d4b\u8bd5PHP\u6587\u4ef6\u6765\u5b8c\u6210\u6b64\u64cd\u4f5c\u3002info.php\u5728\u6587\u672c\u7f16\u8f91\u5668\u4e2d\u6253\u5f00\u6587\u6863\u6839\u76ee\u5f55\u4e2d\u8c03\u7528\u7684\u65b0\u6587\u4ef6\uff1a<\/p>\n\n\n\n<p>sudo vim \/var\/www\/html\/info.php<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u4e3a\u5185\u5bb9<\/p>\n\n\n\n<blockquote class=\"wp-block-quote has-text-align-left is-layout-flow wp-block-quote-is-layout-flow\"><p>&lt;?php<br>phpinfo();<\/p><\/blockquote>\n\n\n\n<p>\u5b8c\u6210\u540e\uff0c\u4fdd\u5b58\u5e76\u5173\u95ed\u6587\u4ef6\u3002<\/p>\n\n\n\n<p>\u73b0\u5728\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u8bbf\u95ee  \u670d\u52a1\u5668ip\/info.php\uff0c \u67e5\u770bPhp\u662f\u5426\u6b63\u5e38\u8fd0\u884c\u548cphp\u76f8\u5173\u4fe1\u606f<\/p>\n\n\n\n<p id=\"item-2\"><strong>\u73b0\u5728\u914d\u7f6eWordPress\u76f8\u5173<\/strong><\/p>\n\n\n\n<p id=\"item-2-6\"><strong>\u4e3aWordPress\u521b\u5efaMySQL\u6570\u636e\u5e93\u548c\u7528\u6237<\/strong><\/p>\n\n\n\n<p>WordPress\u4f7f\u7528MySQL\u6765\u7ba1\u7406\u548c\u5b58\u50a8\u7ad9\u70b9\u548c\u7528\u6237\u4fe1\u606f\u3002\u6211\u4eec\u5df2\u7ecf\u5b89\u88c5\u4e86MySQL\uff0c\u4f46\u662f\u6211\u4eec\u9700\u8981\u4e3aWordPress\u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\u548c\u7528\u6237\u3002<\/p>\n\n\n\n<p>MySQL\u767b\u5f55:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<p>\u8f93\u5165\u5b89\u88c5mysql\u65f6\u5019\u7684\u5bc6\u7801<\/p>\n\n\n\n<p>\u9996\u5148\uff0c\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2aWordPress\u53ef\u4ee5\u63a7\u5236\u7684\u72ec\u7acb\u6570\u636e\u5e93\u3002\u4f60\u53ef\u4ee5\u968f\u610f\u8c03\u7528\u5b83\uff0c\u4f46\u6211\u4eec\u5c06wordpress\u5728\u672c\u6307\u5357\u4e2d\u4f7f\u7528\u5b83\u6765\u4fdd\u6301\u7b80\u5355\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u952e\u5165\u4ee5\u4e0b\u547d\u4ee4\u4e3aWordPress\u521b\u5efa\u6570\u636e\u5e93\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u5176\u4e2dwordpress\u53ea\u662f\u4e3a\u6570\u636e\u5e93\u540d\u79f0\uff0c\u53ef\u4ee5\u968f\u610f\u4fee\u6539\n<strong>CREATE<\/strong> <strong>DATABASE<\/strong> wordpress <strong>DEFAULT<\/strong> <strong>CHARACTER<\/strong> <strong>SET<\/strong> utf8 <strong>COLLATE<\/strong> utf8_unicode_ci;<\/code><\/pre>\n\n\n\n<p>\u6211\u4eec\u5c06\u521b\u5efa\u6b64\u5e10\u6237\uff0c\u8bbe\u7f6e\u5bc6\u7801\u5e76\u6388\u4e88\u5bf9\u6211\u4eec\u521b\u5efa\u7684\u6570\u636e\u5e93\u7684\u8bbf\u95ee\u6743\u9650\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b8c\u6210\u6b64\u64cd\u4f5c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u5176\u4e2dwordpress\u4e3a\u6570\u636e\u5e93\u540d\u79f0\uff0cwordpressuser\u4e3a\u521b\u5efa\u7684\u7528\u6237\u7684\u540d\u79f0\uff0c<strong>password<\/strong>\u4e3a\u521b\u5efa\u7684\u7528\u6237\u7684\u5bc6\u7801\n<strong>GRANT<\/strong> <strong>ALL<\/strong> <strong>ON<\/strong> wordpress.* <strong>TO<\/strong> 'wordpressuser'@'localhost' IDENTIFIED <strong>BY<\/strong> 'password';<\/code><\/pre>\n\n\n\n<p>\u5237\u65b0\u6743\u9650\uff0c\u4ee5\u4fbfMySQL\u7684\u5f53\u524d\u5b9e\u4f8b\u77e5\u9053\u6211\u4eec\u6700\u8fd1\u505a\u51fa\u7684\u66f4\u6539\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>FLUSH PRIVILEGES<em>;<\/em><\/code><\/pre>\n\n\n\n<p>\u9000\u51fa<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>EXIT<em>;<\/em><\/code><\/pre>\n\n\n\n<p id=\"item-2-7\"><strong>\u8c03\u6574Nginx\u7684\u914d\u7f6e\u4ee5\u6b63\u786e\u5904\u7406WordPress<\/strong><\/p>\n\n\n\n<p>\u4f7f\u7528\u4ee5\u4e0bsudo\u6743\u9650\u6253\u5f00\u9ed8\u8ba4\u670d\u52a1\u5668\u5757\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim&nbsp;\/etc\/nginx\/sites-available\/<strong>default<\/strong><\/code><\/pre>\n\n\n\n<p>\u5728\u4e3bserver\u5757\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u6dfb\u52a0\u51e0\u4e2alocation\u5757\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>server<\/strong> {\n    . . .\n    #\u4ee5\u4e0b\u4e3a\u9700\u8981\u6dfb\u52a0\u7684<strong>location<\/strong>\n    <strong>location<\/strong> = \/favicon.ico { log_not_found <strong>off<\/strong>; access_log <strong>off<\/strong>; }\n    <strong>location<\/strong> = \/robots.txt { log_not_found <strong>off<\/strong>; access_log <strong>off<\/strong>; allow <strong>all<\/strong>; }\n    <strong>location<\/strong> ~* \\.(css|gif|ico|jpeg|jpg|js|png)$ {\n        expires max;\n        log_not_found <strong>off<\/strong>;\n    }\n    . . .\n}<\/code><\/pre>\n\n\n\n<p>\u8c03\u6574try_files\u5217\u8868\uff0c\u4ee5\u4fbf\u4e0d\u662f\u5c06404\u9519\u8bef\u4f5c\u4e3a\u9ed8\u8ba4\u9009\u9879\u8fd4\u56de\uff0c\u800c\u662findex.php\u4f7f\u7528\u8bf7\u6c42\u53c2\u6570\u5c06\u63a7\u5236\u4f20\u9012\u7ed9\u6587\u4ef6\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n    . . .\n    location \/ {\n        <em>#try_files $uri $uri\/ =404;<\/em>\n        try_files $uri $uri\/ \/index.php$is_args$args;\n    }\n    . . .\n}<\/code><\/pre>\n\n\n\n<p>\u5b8c\u6210\u540e\uff0c\u4fdd\u5b58\u5e76\u5173\u95ed\u6587\u4ef6\u3002<\/p>\n\n\n\n<p>\u68c0\u67e5Nginx\u8bed\u6cd5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nginx -t<\/code><\/pre>\n\n\n\n<p>\u91cd\u542f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl reload nginx<\/code><\/pre>\n\n\n\n<p id=\"item-2-8\"><strong>\u5b89\u88c5\u5176\u4ed6PHP\u6269\u5c55<\/strong><\/p>\n\n\n\n<p>WordPress\u53ca\u5176\u8bb8\u591a\u63d2\u4ef6\u9700\u8981\u4e00\u4e9b\u989d\u5916\u7684PHP\u6269\u5c55\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u4e0b\u8f7d\u5e76\u5b89\u88c5\u4e00\u4e9b\u6700\u6d41\u884c\u7684PHP\u6269\u5c55\u4ee5\u4e0eWordPress\u4e00\u8d77\u4f7f\u7528\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-<strong>get<\/strong> <strong>update<\/strong>\nsudo apt-<strong>get<\/strong> install php7.4-curl php7.4-gd php7.4-mbstring php7.4-<strong>xml<\/strong> php7.4-xmlrpc php7.4-imagick php7.4-zip<\/code><\/pre>\n\n\n\n<p>\u91cd\u542fPHP<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo&nbsp;systemctl restart php7.4-fpm<\/code><\/pre>\n\n\n\n<p><strong>\u4e0b\u8f7dWordPress<\/strong><\/p>\n\n\n\n<p>\u901a\u8fc7\u4f60\u81ea\u5df1\u7684\u65b9\u5f0f\u4e0b\u8f7d\u5e76\u89e3\u538bwordpress\u7684\u6587\u4ef6\uff0c\u5e76\u590d\u5236\u6839\u76ee\u5f55\u4e0bwp-config-sample.php\u4e3a wp-config.php<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cp&nbsp;\/tmp\/wordpress\/wp-config-sample.php \/tmp\/wordpress\/wp-config.php<\/code><\/pre>\n\n\n\n<p><strong>\u914d\u7f6eWordPress\u76ee\u5f55<\/strong><\/p>\n\n\n\n<p>\u6211\u4eec\u9700\u8981\u5b8c\u6210\u7684\u4e00\u4ef6\u5927\u4e8b\u662f\u5efa\u7acb\u5408\u7406\u7684\u6587\u4ef6\u6743\u9650\u548c\u6240\u6709\u6743\u3002\u6211\u4eec\u9700\u8981\u80fd\u591f\u4ee5\u666e\u901a\u7528\u6237\u7684\u8eab\u4efd\u5199\u5165\u8fd9\u4e9b\u6587\u4ef6\uff0c\u5e76\u4e14\u6211\u4eec\u9700\u8981Web\u670d\u52a1\u5668\u4e5f\u80fd\u591f\u8bbf\u95ee\u548c\u8c03\u6574\u67d0\u4e9b\u6587\u4ef6\u548c\u76ee\u5f55\u624d\u80fd\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u9996\u5148\u5c06\u6587\u6863\u6839\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u7684\u6240\u6709\u6743\u5206\u914d\u7ed9\u7528\u6237\u540d\u3002\u6211\u4eec\u5c06root\u5728\u672c\u6307\u5357\u4e2d\u4f7f\u7528\u6211\u4eec\u7684\u7528\u6237\u540d\uff0c\u4f46\u60a8\u5e94\u8be5\u66f4\u6539\u6b64\u9009\u9879\u4ee5\u5339\u914d\u60a8\u7684sudo\u7528\u6237\u8c03\u7528\u3002\u6211\u4eec\u4f1a\u5c06\u7fa4\u7ec4\u6240\u6709\u6743\u5206\u914d\u7ed9www-data\u7fa4\u7ec4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chown -R root:www-data&nbsp;\/var\/www\/html<\/code><\/pre>\n\n\n\n<p>\u914d\u7f6esetgit\u4f4d<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>sudo<\/strong>&nbsp;find \/var\/www\/html -<strong>type<\/strong>&nbsp;d -exec chmod g+s {} \\;<\/code><\/pre>\n\n\n\n<p>\u4e3awp-content\u76ee\u5f55\u63d0\u4f9b\u7ec4\u5199\u8bbf\u95ee\u6743\u9650\uff0c\u4ee5\u4fbfWeb\u754c\u9762\u53ef\u4ee5\u8fdb\u884c\u4e3b\u9898\u548c\u63d2\u4ef6\u66f4\u6539\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chmod g+w&nbsp;\/var\/www\/html\/wp-content<\/code><\/pre>\n\n\n\n<p>\u4e3aWeb\u670d\u52a1\u5668\u63d0\u4f9b\u5bf9\u8fd9\u4e24\u4e2a\u76ee\u5f55\u4e2d\u6240\u6709\u5185\u5bb9\u7684\u5199\u8bbf\u95ee\u6743\u9650\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chmod -R g+w \/var\/www\/html\/wp-content\/themes\nsudo chmod -R g+w \/var\/www\/html\/wp-content\/plugins<\/code><\/pre>\n\n\n\n<p>\u8fd9\u53ea\u662f\u4e00\u4e2a\u5408\u7406\u7684\u6743\u9650\u8bbe\u7f6e\u5f00\u59cb\uff0c\u4e00\u4e9b\u63d2\u4ef6\u53ef\u80fd\u9700\u8981\u5355\u72ec\u914d\u7f6e\u3002<\/p>\n\n\n\n<p id=\"item-2-11\"><strong>\u8bbe\u7f6eWordPress\u914d\u7f6e\u6587\u4ef6<\/strong><\/p>\n\n\n\n<p>\u73b0\u5728\uff0c\u6211\u4eec\u9700\u8981\u5bf9\u4e3bWordPress\u914d\u7f6e\u6587\u4ef6\u8fdb\u884c\u4e00\u4e9b\u66f4\u6539\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim&nbsp;\/var\/www\/html\/wp-config.php<\/code><\/pre>\n\n\n\n<p>\u6570\u636e\u5e93\u8fde\u63a5\u8bbe\u7f6e\u4e0b\u65b9\u6216\u6587\u4ef6\u4e2d\u7684\u4efb\u4f55\u5176\u4ed6\u4f4d\u7f6e\u6dfb\u52a0\u6b64\u8bbe\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>. . .\n<em>\/** MySQL database name *\/<\/em>\n<strong>define<\/strong>('DB_NAME', 'wordpress');\n\n<em>\/** MySQL database username *\/<\/em>\n<strong>define<\/strong>('DB_USER', 'wordpressuser');\n\n<em>\/** MySQL database password *\/<\/em>\n<strong>define<\/strong>('DB_PASSWORD', 'password');\n\n. . .\n\n<strong>define<\/strong>('FS_METHOD', 'direct');<\/code><\/pre>\n\n\n\n<p>\u5b8c\u6210\u540e\u4fdd\u5b58\u5e76\u5173\u95ed\u6587\u4ef6\u3002<\/p>\n\n\n\n<p>\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee\u4f60\u7684\u670d\u52a1\u5668\u5730\u5740\u5b8c\u6210\u914d\u7f6e\u3002<\/p>\n\n\n\n<p id=\"item-2-14\"><strong>\u5230\u6b64\u5904wordpress\u90e8\u7f72\u6210\u529f\u3002<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8bb0\u5f55Quark N\u6298\u817e\u7684\u8fc7\u7a0b\uff0c\u5305\u62ec\u76f8\u5173\u914d\u7f6e\u3001\u8bbe\u5b9a\u7b49\u3002<\/p>\n","protected":false},"author":1,"featured_media":241,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,9],"tags":[],"class_list":["post-19","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-9"],"_links":{"self":[{"href":"https:\/\/blog.glab.online\/index.php?rest_route=\/wp\/v2\/posts\/19","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.glab.online\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.glab.online\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.glab.online\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.glab.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19"}],"version-history":[{"count":0,"href":"https:\/\/blog.glab.online\/index.php?rest_route=\/wp\/v2\/posts\/19\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.glab.online\/index.php?rest_route=\/wp\/v2\/media\/241"}],"wp:attachment":[{"href":"https:\/\/blog.glab.online\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.glab.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.glab.online\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}