{"id":28896,"date":"2024-11-25T11:49:31","date_gmt":"2024-11-25T03:49:31","guid":{"rendered":"https:\/\/fwq.ai\/blog\/28896\/"},"modified":"2024-11-25T11:49:31","modified_gmt":"2024-11-25T03:49:31","slug":"ubuntu-lnmp%e6%80%8e%e4%b9%88%e9%83%a8%e7%bd%b2wordpress","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/28896\/","title":{"rendered":"Ubuntu LNMP\u600e\u4e48\u90e8\u7f72WordPress"},"content":{"rendered":"<p>\u4e0b\u9762\u7531\/&#8221; target=&#8221;_blank&#8221;&gt;<strong>wordpress<\/strong>\u6559\u7a0b\u680f\u76ee\u7ed9\u5927\u5bb6\u4ecb\u7ecdubuntu lnmp\u600e\u4e48\u90e8\u7f72 wordpress\uff0c\u5e0c\u671b\u5bf9\u9700\u8981\u7684\u670b\u53cb\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n<p><strong>Ubuntu LNMP \u90e8\u7f72 WordPress<\/strong> <\/p>\n<p>\u8f6f\u4ef6\u7248\u672c\u8bf4\u660e\uff1a<\/p>\n<ul>\n<li>\n<p>Ubuntu: 16.04 LTS;<\/p>\n<\/li>\n<li>\n<p>WordPress: 4.7 zh-CN<\/p>\n<\/li>\n<\/ul>\n<blockquote><p>\n  \u9002\u7528\u4eba\u7fa4\uff1a\u521d\u7ea7 PHP \u5165\u95e8\u8005\u548c\u5e7f\u5927\u60f3\u62e5\u6709\u81ea\u5df1\u7ad9\u70b9\u7684\u8bbe\u8ba1\u5e08\uff01\n<\/p><\/blockquote>\n<h1>\u5b89\u88c5 PHP7.1<\/h1>\n<p><strong>1.\u9996\u5148\u6dfb\u52a0 PPA<\/strong><\/p>\n<pre>sudo apt-get update\nsudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej\/php -y\nsudo apt-get update<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2.\u7136\u540e\uff0c\u5b89\u88c5 PHP7.1<\/strong><\/p>\n<pre>sudo apt-get -y install php7.1\nsudo apt-get -y install php7.1-mysql php7.1-fpm<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h1>\u5b89\u88c5 Mysql<\/h1>\n<pre>sudo apt-get -y install mysql-server-5.7<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8bbe\u7f6e\u5bc6\u7801\u5c31\uff0cOK\u3002<\/p>\n<p>\u81f3\u6b64\uff0c\u57fa\u672c\u7684 WordPress \u73af\u5883\u5c31\u51c6\u5907\u5b8c\u6bd5\u4e86\u3002<\/p>\n<h1>\u90e8\u7f72 WordPress<\/h1>\n<p>\u9996\u5148\u901a\u8fc7 git \u62c9\u53d6 WordPress \u6e90\u4ee3\u7801\uff1a<\/p>\n<pre>git clone https:\/\/github.com\/JellyBool\/wordpress.git \/var\/www\/wordpress<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h1>\u914d\u7f6e Mysql<\/h1>\n<p>\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u6765\u767b\u5f55 mysql\uff1a<\/p>\n<pre>mysql -u root -p<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5728 mysql \u6267\u884c\uff1a<\/p>\n<pre>CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;\n\nCREATE USER 'jellybool' IDENTIFIED BY 'laravist';\nGRANT ALL PRIVILEGES ON wordpress.* TO 'jellybool';\n\nquit<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<blockquote>\n<p>\u6ce8\u610f\u4e0a\u9762\u7684 jellybool\u548claravist\u662f\u6839\u636e\u4f60\u81ea\u5df1\u7684\u9700\u6c42\u6765\u8bbe\u7f6e\u7684\u3002<\/p>\n<\/blockquote>\n<h1>\u914d\u7f6e Nginx<\/h1>\n<p>\u6253\u5f00\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<pre>vim \/etc\/nginx\/sites-available\/default<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fdb\u884c\u4ee5\u4e0b\u914d\u7f6e\u914d\u7f6e\uff1a<\/p>\n<pre>root \/var\/www\/wordpress;\n\nindex index.php index.html index.htm index.nginx-debian.html;\n# \u6ce8\u610f\u6211\u4eec\u6dfb\u52a0\u4e86 index.php\n\nlocation \/ {\n        try_files $uri $uri\/ \/index.php?$query_string;\n    }\nlocation ~ .php$ {\n        try_files $uri \/index.php =404;\n        fastcgi_split_path_info ^(.+.php)(\/.+)$;\n        fastcgi_pass unix:\/var\/run\/php\/php7.1-fpm.sock;\n        fastcgi_index index.php;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        include fastcgi_params;\n }<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8bbf\u95ee\u4f60\u7684\u57df\u540d\uff0c\u5c31\u53ef\u4ee5\u8fdb\u884c\u975e\u5e38\u51fa\u540d\u7684 WordPress \u4e94\u5206\u949f\u5b89\u88c5\u8fc7\u7a0b\u5566\uff01\u5b89\u88c5\u5b8c\u6bd5\u4e4b\u540e\uff0c\u4f60\u5c31\u62e5\u6709\u4e00\u4e2a WordPress \u7684\u7ad9\u70b9\u5566\uff01<\/p>\n<h1>\u6700\u540e<\/h1>\n<p>\u914d\u7f6e WordPress \u6587\u4ef6\u4e0a\u4f20\uff0c\u6253\u5f00 wp-config.php \u6587\u4ef6\uff1a<\/p>\n<pre>define('FS_METHOD', 'direct');\ndefine('FS_CHMOD_DIR', 0777);\ndefine('FS_CHMOD_FILE', 0777);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<h1>\u5b89\u88c5\u5176\u4ed6\u7684 php \u6269\u5c55<\/h1>\n<pre>sudo apt install -y php7.1-gd php7.1-mbstring php7.1-xmlrpc<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u81f3\u6b64\uff0c\u6253\u5b8c\u6536\u5de5\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fUbuntu LNMP\u600e\u4e48\u90e8\u7f72WordPress\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0b\u9762\u7531\/&#8221; target=&#8221;_blank&#8221;&gt;wordpress\u6559\u7a0b\u680f\u76ee\u7ed9\u5927\u5bb6\u4ecb\u7ecdubuntu lnmp\u600e\u4e48\u90e8\u7f72 wordpress\uff0c\u5e0c\u671b\u5bf9\u9700\u8981\u7684\u670b\u53cb\u6709\u6240\u5e2e\u52a9\uff01 Ubuntu LNMP \u90e8\u7f72 WordPress \u8f6f\u4ef6\u7248\u672c\u8bf4\u660e\uff1a Ubuntu: 16.04 LTS; WordPress: 4.7 zh-CN \u9002\u7528\u4eba\u7fa4\uff1a\u521d\u7ea7 PHP \u5165\u95e8\u8005\u548c\u5e7f\u5927\u60f3\u62e5\u6709\u81ea\u5df1\u7ad9\u70b9\u7684\u8bbe\u8ba1\u5e08\uff01 \u5b89\u88c5 PHP7.1 1.\u9996\u5148\u6dfb\u52a0 PPA sudo apt-get update sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej\/php -y sudo apt-get update \u767b\u5f55\u540e\u590d\u5236 2.\u7136\u540e\uff0c\u5b89\u88c5 PHP7.1 sudo apt-get -y install php7.1 sudo apt-get -y install php7.1-mysql php7.1-fpm \u767b\u5f55\u540e\u590d\u5236 \u5b89\u88c5 Mysql sudo apt-get -y install mysql-server-5.7 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-28896","post","type-post","status-publish","format-standard","hentry","category-cms"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28896","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=28896"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28896\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=28896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=28896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=28896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}