{"id":1837,"date":"2021-03-10T07:31:57","date_gmt":"2021-03-09T23:31:57","guid":{"rendered":"http:\/\/blog.zengqq.com.cn\/?p=1837"},"modified":"2021-05-03T19:30:24","modified_gmt":"2021-05-03T11:30:24","slug":"raspberry-pi-4b-lamp-lnmp%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/blog.zengqq.com.cn\/?p=1837","title":{"rendered":"Raspberry Pi 4B LAMP\/LNMP\u914d\u7f6e"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\"><a href=\"https:\/\/www.cnblogs.com\/fjlinww\/p\/12512796.html\">Raspberry Pi 4B LAMP\/LNMP\u914d\u7f6e<\/a>(\u8f6c\u8f7d\u81ea\u6b64\u94fe\u63a5\uff09<\/h1>\n\n\n\n<p>Hereby just want to discuss about the advantage and disadvantage of application which being established based on Apache and based on Nginx .<\/p>\n\n\n\n<p>first of all, let&#8217;s using the \u5f52\u7c7b\u6cd5 to understand the Apache and Nginx more deeper<span style=\"color:#a30400\" class=\"has-inline-color\">(\u5f88\u660e\u663e\u554a\uff0c\u6211\u7b54\u4e0d\u51fa\u6765\uff0c\u5475\u5475,since like I have no idea about them, neither from their definition nor from their application):<\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><span style=\"color:#a30000\" class=\"has-inline-color\">\u76f8\u540c\u70b9\uff1a<\/span><ul><li><span style=\"color:#a30000\" class=\"has-inline-color\">\u4ece\u6211\u76ee\u524d\u7406\u89e3\u6765\u770b\uff0c\u5c31\u662f\u4ed6\u4eec\u5171\u540c\u6784\u5efa\u4e00\u4e2aL _ MP\u7684\u201d\u5e94\u7528\u73af\u5883\u201c,<\/span><\/li><li><span style=\"color:#a30000\" class=\"has-inline-color\">where: <\/span><ul><li><span style=\"color:#a30000\" class=\"has-inline-color\">letter &#8220;L&#8221; means Linux, <\/span><\/li><li><span style=\"color:#a30000\" class=\"has-inline-color\">&#8220;_&#8221; either Apache or Nginx, <\/span><\/li><li><span style=\"color:#a30000\" class=\"has-inline-color\">letter &#8220;M&#8221; means MySQL or MariaDB and also suitable for other data base, <\/span> <\/li><li><span style=\"color:#a30000\" class=\"has-inline-color\">letter &#8220;P&#8221; means <s>Program, so far as I know like a &#8220;WordPress&#8221;<\/s><\/span> \u8fd9\u91cc\u5b9e\u9645\u4e0a\u662f\u6307\u7684PHP, which means \u8d85\u6587\u672c\u9884\u5904\u7406\u5668  hypertext preprocessor,\u5176\u5b9e\u66f4\u65e9\u4e4b\u524d\u8fd9\u4e2aPHP\u88ab\u53d1\u660e\u8005Rasmus Lerdorf\u53eb\u505a\u4e2a\u4eba\u7f51\u9875Personal Home Page\uff0c\u4f46\u5728PHP3\u7684\u65f6\u5019\u88ab\u4ee5\u8272\u5217\u7684\u7a0b\u5e8f\u5458\u91cd\u65b0\u5b9a\u4e49\u4e3a Chao-Wenben-Yu-Chuliqi,\u54c8\u54c8\u54c8\u54c8!<\/li><\/ul><\/li><\/ul><\/li><li><span style=\"color:#a30000\" class=\"has-inline-color\">\u4e0d\u540c\u70b9\uff1a<\/span><ul><li><span style=\"color:#a30000\" class=\"has-inline-color\">Apache: <\/span><\/li><li><span style=\"color:#a30000\" class=\"has-inline-color\">Nginx:<\/span><\/li><\/ul><\/li><\/ul>\n\n\n\n<p>\u76ee\u5f55<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.cnblogs.com\/fjlinww\/p\/12512796.html#lamp\">LAMP<\/a><ul><li><a href=\"https:\/\/www.cnblogs.com\/fjlinww\/p\/12512796.html#1%E5%AE%89%E8%A3%85mariadb\">1.\u5b89\u88c5Mariadb<\/a><\/li><li><a href=\"https:\/\/www.cnblogs.com\/fjlinww\/p\/12512796.html#2-%E5%AE%89%E8%A3%85php%E5%92%8Capache\">2. \u5b89\u88c5PHP\u548capache<\/a><\/li><li><a href=\"https:\/\/www.cnblogs.com\/fjlinww\/p\/12512796.html#3-%E6%B5%8B%E8%AF%95php%E5%92%8Capache%E7%9A%84%E5%8D%8F%E5%90%8C\">3. \u6d4b\u8bd5php\u548capache\u7684\u534f\u540c<\/a><\/li><li><a href=\"https:\/\/www.cnblogs.com\/fjlinww\/p\/12512796.html#4-%E4%BF%AE%E6%94%B9mariadb%E6%95%B0%E6%8D%AE%E5%BA%93%E9%85%8D%E7%BD%AE\">4. \u4fee\u6539MariaDB\u6570\u636e\u5e93\u914d\u7f6e<\/a><\/li><li><a href=\"https:\/\/www.cnblogs.com\/fjlinww\/p\/12512796.html#5%E6%B5%8B%E8%AF%95%E6%95%B0%E6%8D%AE%E5%BA%93%E8%BF%9E%E6%8E%A5\">5.\u6d4b\u8bd5\u6570\u636e\u5e93\u8fde\u63a5<\/a><\/li><li><a href=\"https:\/\/www.cnblogs.com\/fjlinww\/p\/12512796.html#6-%E4%BF%AE%E6%94%B9apache2%E7%9B%91%E5%90%AC%E7%AB%AF%E5%8F%A3\">6. \u4fee\u6539apache2\u76d1\u542c\u7aef\u53e3<\/a><\/li><\/ul><\/li><li><a href=\"https:\/\/www.cnblogs.com\/fjlinww\/p\/12512796.html#lnmp\">LNMP<\/a><ul><li><a href=\"https:\/\/www.cnblogs.com\/fjlinww\/p\/12512796.html#1-%E5%AE%89%E8%A3%85mariadb\">1. \u5b89\u88c5Mariadb<\/a><\/li><li><a href=\"https:\/\/www.cnblogs.com\/fjlinww\/p\/12512796.html#2-%E5%AE%89%E8%A3%85%E5%92%8C%E9%85%8D%E7%BD%AEnginx\">2. \u5b89\u88c5\u548c\u914d\u7f6enginx<\/a><\/li><li><a href=\"https:\/\/www.cnblogs.com\/fjlinww\/p\/12512796.html#3-%E5%AE%89%E8%A3%85php-fpm\">3. \u5b89\u88c5php-fpm<\/a><\/li><li><a href=\"https:\/\/www.cnblogs.com\/fjlinww\/p\/12512796.html#4-%E6%B5%8B%E8%AF%95\">4. \u6d4b\u8bd5<\/a><\/li><\/ul><\/li><\/ul>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"lamp\">LAMP<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1\u5b89\u88c5mariadb\">1.\u5b89\u88c5Mariadb<\/h2>\n\n\n\n<p>\u5728Raspberry Pi\u4e2d\uff0cMySQL\u65e0\u6cd5\u5b89\u88c5\uff0c\u4f1a\u81ea\u52a8\u5efa\u8bae\u5b89\u88c5Mariadb\uff0c\u5b83\u548cMySQL\u540c\u6e90\uff0c\u5177\u4f53\u4ecb\u7ecd\u5927\u5bb6\u53ef\u81ea\u884c\u641c\u7d22\u3002<\/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=\"\">$ sudo apt-get install mariadb-server mariadb-client\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2-\u5b89\u88c5php\u548capache\">2. \u5b89\u88c5PHP\u548capache<\/h2>\n\n\n\n<p>phpmyadmin\u4f1a\u81ea\u52a8\u628a\u5176\u4ed6\u76f8\u5173\u4f9d\u8d56\uff08\u5305\u62ecapapche2\uff09\u90fd\u88c5\u597d\uff0c\u5b89\u88c5\u8fc7\u7a0b<strong>\u8981\u9009\u62e9\u548capache\u534f\u540c<\/strong>\uff0c\u8fd8\u53ef\u8bbe\u7f6ephpmyadmin\u7528\u6237\u5bc6\u7801\uff0c\u6ce8\u610f\u8981\u5148\u88c5\u524d\u9762\u7684\u6570\u636e\u5e93\uff0c\u8fd9\u6837\u8bbe\u7f6e\u8fc7\u7a0b\u624d\u4e0d\u4f1a\u51fa\u73b0\u6570\u636e\u5e93\u8fde\u63a5\u9519\u8bef\u3002(\u6b64\u5904\u6211\u9047\u5230\u4e86\u95ee\u9898\uff0c\u9519\u8bef\u4e2d\u53ea\u80fd\u662f\u5427php\u5347\u7ea7\u52308.0\uff09<\/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=\"\">$ sudo apt-get install phpmyadmin\n$ sudo apt-get install apache2 #\u5b9e\u9645\u4e0d\u9700\u8981\u6267\u884c\u547d\u4ee4\uff0cphpmyadmin\u4f1a\u9644\u5e26\u628aapache2\u88c5\u597d\n$ sudo apt-get install libapache2-mod-php #\u8fd9\u4e2a\u6ca1\u5b89\u88c5apache\u53ef\u80fd\u89e3\u6790\u4e0d\u4e86php\u4ee3\u7801\uff0c\u5bfc\u81f4\u9875\u9762\u4e0a\u76f4\u63a5\u663e\u793aphp\u4ee3\u7801\n$ sudo ln -s \/usr\/share\/phpmyadmin\/ \/var\/www\/html\/  #\u5728apache\u9ed8\u8ba4web\u76ee\u5f55\u4e0b\u6dfb\u52a0phpmyadmin\u7684\u8f6f\u94fe\u63a5\uff0c\u5426\u5219\u540e\u8005\u65e0\u6cd5\u6253\u5f00\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"3-\u6d4b\u8bd5php\u548capache\u7684\u534f\u540c\">3. \u6d4b\u8bd5php\u548capache\u7684\u534f\u540c<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>\u6d4b\u8bd5apache<br><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317190757559-279984630.png\" alt=\"\"><\/li><li>\u6d4b\u8bd5php\u9875\u9762<br>\u5728\u9ed8\u8ba4\u7684\u7f51\u7ad9\u6839\u76ee\u5f55\/var\/www\/html\/\u4e0b\u65b0\u589ephp\u7a0b\u5e8fphpinfo.php\uff0c\u5e76\u6dfb\u52a0\u5185\u5bb9\uff1a<\/li><\/ul>\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=\"\">&lt;?php phpinfo(); ?>\n<\/pre>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317190456137-900289023.png\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"4-\u4fee\u6539mariadb\u6570\u636e\u5e93\u914d\u7f6e\">4. \u4fee\u6539MariaDB\u6570\u636e\u5e93\u914d\u7f6e<\/h2>\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=\"\">$ sudo mysql_secure_installation #\u8bbe\u7f6eroot\u5bc6\u7801\uff0c\u662f\u5426\u5220\u9664\u533f\u540d\u7528\u6237\uff0c\u662f\u5426\u53ea\u5141\u8bb8localhost\u8fde\u63a5\uff0c\u662f\u5426\u5220\u9664test\u5e93\uff0c\u6700\u540e\u66f4\u65b0\u6743\u9650\u3002\n<\/pre>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317190946104-365495813.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317191010901-121285496.png\" alt=\"\"\/><\/figure>\n\n\n\n<p>\u4e4b\u540e\u5728\u7ec8\u7aef\u7528root\u767b\u5f55\u6570\u636e\u5e93<\/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=\"\"># mysql -u root -p\n<\/pre>\n\n\n\n<p>\u53d1\u73b0\u4f1a\u62a5\u9519\u201c<strong>ERROR 1698 (28000): Access denied for user &#8216;root&#8217;@&#8217;localhost&#8217;<\/strong>\u201d\uff0c<a href=\"https:\/\/blog.csdn.net\/jdyanghang\/article\/details\/102782780\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>\u6811\u8393\u6d3e4B\u5b89\u88c5PHP7.3 + Nginx + MySQL \u6559\u7a0b<\/strong><\/a>\u7ed9\u51fa\u4e86\u89e3\u51b3\u529e\u6cd5<\/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=\"\">$ sudo mysql -u root\nMariaDB [(none)]> use mysql\uff1b\nMariaDB [mysql]> update user set plugin='mysql_native_password';\nMariaDB [mysql]> flush privileges; \n<\/pre>\n\n\n\n<p>\u4e4b\u540e\u91cd\u65b0\u4f7f\u7528root\u5bc6\u7801\u767b\u5f55\uff0c\u6210\u529f\u3002<br><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317191252086-1006554417.png\" alt=\"\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"5\u6d4b\u8bd5\u6570\u636e\u5e93\u8fde\u63a5\">5.\u6d4b\u8bd5\u6570\u636e\u5e93\u8fde\u63a5<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>\u7f16\u5199php\u8fde\u63a5\u6570\u636e\u5e93\u7684\u811a\u672ctestdblink.php\uff08\u6211\u4e60\u60ef\u7528PDO\u8fde\u63a5\uff0c\u6d4b\u8bd5\u8d26\u53f7root\uff09<\/li><\/ul>\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=\"\">&lt;?php\n\n$servername = \"localhost\";\n$dbName = \"mysql\";\n$username = \"root\";\n$password = \"\u6b64\u5904\u8f93\u5165root\u5bc6\u7801\";\n\ntry {\n    $conn = new PDO(\"mysql:host=$servername;dbname=$dbName\", $username, $password);\n    echo \"\u8fde\u63a5\u6210\u529f\";\n}\ncatch(PDOException $e)\n{\n    echo $e->getMessage();\n}\n?>\n<\/pre>\n\n\n\n<p>\u4fdd\u5b58\u4e3atestdblink.php\u653e\u5728apache\u7684<strong>\/var\/www\/html<\/strong>\u9ed8\u8ba4\u76ee\u5f55\u4e0b\u6d4b\u8bd5\u3002<br><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317191503322-1961325957.png\" alt=\"\"><\/p>\n\n\n\n<p>\u7531\u4e8e\u5b89\u88c5\u4e86phpmyadmin\uff0c\u5c31\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7web\u7ba1\u7406\u6570\u636e\u5e93\u4e86\u3002<br>\u767b\u5f55\u5730\u5740\uff1ahttp:\/\/<strong>\u670d\u52a1\u5668ip\u5730\u5740<\/strong>\/phpmyadmin\/index.php<br><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317191758029-2066121034.png\" alt=\"\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"6-\u4fee\u6539apache2\u76d1\u542c\u7aef\u53e3\">6. \u4fee\u6539apache2\u76d1\u542c\u7aef\u53e3<\/h2>\n\n\n\n<p>apache2\u9ed8\u8ba4\u76d1\u542c80\u7aef\u53e3\uff0c\u5982\u679c\u4e0d\u5e0c\u671b\u8fd9\u4e2a\u7aef\u53e3\u88ab\u4f7f\u7528\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4fee\u6539\u3002<\/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=\"\">$ cd \/etc\/apache2\/\n$ sudo nano ports.conf\n<\/pre>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317220018119-257686196.png\" alt=\"\"\/><\/figure>\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=\"\">$ cd \/etc\/apache2\/sites-enabled\/\n$ sudo nano 000-default.conf\n<\/pre>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317220240724-1077480928.png\" alt=\"\"\/><\/figure>\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=\"\">$ sudo service apache2 restart\n<\/pre>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317220552041-1068168084.png\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317220811793-641837927.png\" alt=\"\"\/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"lnmp\">LNMP<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1-\u5b89\u88c5mariadb\">1. \u5b89\u88c5Mariadb<\/h2>\n\n\n\n<p>\u540clamp<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"2-\u5b89\u88c5\u548c\u914d\u7f6enginx\">2. \u5b89\u88c5\u548c\u914d\u7f6enginx<\/h2>\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=\"\">$ sudo apt-get install nginx\n<\/pre>\n\n\n\n<p>\u5148\u524dapache\u5df2\u5c06\u76d1\u542c\u7aef\u53e3\u4fee\u6539\u81f38080\uff0c\u5c0680\u7aef\u53e3\u817e\u51fa<br>\u4fee\u6539nginx\u914d\u7f6e\u6587\u4ef6<\/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=\"\">$ sudo nano \/etc\/nginx\/sites-available\/default\n<\/pre>\n\n\n\n<p>\u4fdd\u630180\u7aef\u53e3\u76d1\u542c<br><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317221816953-1734196766.png\" alt=\"\"><\/p>\n\n\n\n<p>\u624b\u5de5\u8ffd\u52a0index.php\u3002\u6ce8\u610f\u5230\u201croot \/var\/www\/html\uff1b\u201d\uff0c\u8bf4\u660enginx\u7684\u9ed8\u8ba4\u6839\u76ee\u5f55\u662f\/var\/www\/html\uff0cWeb\u9875\u9762\u6587\u4ef6\u8981\u653e\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e0b<br><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317222000990-587997056.png\" alt=\"\"><\/p>\n\n\n\n<p>\u5c06<br><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317222041506-353188381.png\" alt=\"\"><br>\u4fee\u6539\u4e3a\u5982\u4e0b\uff1a<br><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317222254463-2034489921.png\" alt=\"\"><\/p>\n\n\n\n<p>\u91cd\u542f<\/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=\"\">$ sudo systemctl restart nginx\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"3-\u5b89\u88c5php-fpm\">3. \u5b89\u88c5php-fpm<\/h2>\n\n\n\n<p>\u5728\u5b89\u88c5phpmyadmin\u65f6\uff0c\u6709\u4e00\u6b65\u9aa4\u662f\u9009\u62e9\u914d\u5408\u7684web\u670d\u52a1\u5668\uff0c\u7531\u4e8e\u8981\u7528nginx\uff0c\u6240\u4ee5\u6b64\u65f6\u90fd\u4e0d\u9009\u653e\u7a7a\u3002php\u5f88\u591a\u7ec4\u4ef6\u5728\u5b89\u88c5phpmyadmin\u65f6\u7ec4\u4ef6\u90fd\u88c5\u4e86\uff0cnginx\u9700\u8981\u53e6\u5916\u88c5php-fpm\u3002<\/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=\"\">$ sudo apt-get install php-fpm\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"4-\u6d4b\u8bd5\">4. \u6d4b\u8bd5<\/h2>\n\n\n\n<p>\u6d4b\u8bd5php\uff0c\u53ef\u4ee5\u53d1\u73b0Server API\u548capache\u7684php\u9875\u9762\u4e0d\u540c<br><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317225147160-757950522.png\" alt=\"\"><br><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200317225304838-1913883511.png\" alt=\"\"><\/p>\n\n\n\n<p>\u6570\u636e\u5e93\u5df2\u7ecf\u5b89\u88c5\uff0c\u76f4\u63a5\u6d4b\u8bd5\u4e5fok\u3002<br><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200319105915510-240715121.png\" alt=\"\"><\/p>\n\n\n\n<p>\u6709\u4e2abug\uff1anginx\u76d1\u542c\u7aef\u53e3\u662f80\uff0capache2\u7684\u76d1\u542c\u7aef\u53e3\u5df2\u7ecf\u6539\u6210\u4e868080\uff0c\u4f46\u662f\u76f4\u63a5\u5728\u6d4f\u89c8\u5668\u90a3\u91cc\u8f93\u5165ip\uff0c\u4ecd\u65e7\u662fapache\u7684\u9875\u9762\uff0c\u800c\u8f93\u5165\u201cip\u5730\u5740\/phpinfo.php\u201d\u65f6\uff0c\u5374\u80fd\u5b9a\u4f4d\u5230fpm\uff0c\u800c\u4e0d\u662fapache\u3002\u7528\u547d\u4ee4\/etc\/init.d\/apache2 stop \u505c\u6b62apache2\u670d\u52a1\uff0c80\u7aef\u53e3\u6b63\u5e388080\u7aef\u53e3\u65e0\u6cd5\u6253\u5f00\uff0c\u8bf4\u660enginx\u6b63\u5e38\uff0c\u4f46\u662f\u9ed8\u8ba4\u9875\u9762\u8fd8\u662fapapche2\u7684\u3002<br>\u89e3\u51b3\uff1a\u6211\u540c\u65f6\u4fdd\u7559\u4e86apache\u548cnginx\uff0c\u7ecf\u67e5\u770b\/var\/www\/html\/\u76ee\u5f55\u53d1\u73b0\uff1a\u76ee\u5f55\u4e2d\u6709index.html\u548c\u53e6\u4e00\u4e2aindex.nginx-debian.html\uff0c\u524d\u8005\u662f\u5b89\u88c5apache\u65f6\u9ed8\u8ba4\u6dfb\u52a0\u7684\u3002\u76f4\u63a5\u5728\u6d4f\u89c8\u5668\u90a3\u91cc\u8f93\u5165ip\u5b9e\u9645\u9ed8\u8ba4\u8bbf\u95ee\u7684\u662fip\/index.html\u3002\u56e0\u6b64\u8981\u6d4b\u8bd5nginx\u7684\u57fa\u672c\u9875\u9762\uff0c\u5e94\u8be5\u8bbf\u95eeip\/index.nginx-debian.html\u3002<br><img decoding=\"async\" src=\"https:\/\/img2020.cnblogs.com\/blog\/1283331\/202003\/1283331-20200319120514899-791277727.png\" alt=\"\">\u5206\u7c7b:&nbsp;<a href=\"https:\/\/www.cnblogs.com\/fjlinww\/category\/1439885.html\" target=\"_blank\" rel=\"noreferrer noopener\">Linux<\/a>\u6807\u7b7e:&nbsp;<a href=\"https:\/\/www.cnblogs.com\/fjlinww\/tag\/%E6%A0%91%E8%8E%93%E6%B4%BE\/\">\u6811\u8393\u6d3e<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Raspberry Pi 4B LAMP\/LNMP [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[253,249],"tags":[349,345,347],"class_list":["post-1837","post","type-post","status-publish","format-standard","hentry","category-fun","category-technology","tag-apache2","tag-lamp","tag-lnmp"],"_links":{"self":[{"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1837","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1837"}],"version-history":[{"count":7,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1837\/revisions"}],"predecessor-version":[{"id":1929,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/1837\/revisions\/1929"}],"wp:attachment":[{"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1837"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1837"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.zengqq.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}