{"id":848,"date":"2020-09-08T23:24:44","date_gmt":"2020-09-08T15:24:44","guid":{"rendered":"https:\/\/www.iotch.xyz\/?p=848"},"modified":"2020-09-08T23:24:44","modified_gmt":"2020-09-08T15:24:44","slug":"%e5%9c%a8raspberry-pi-3-%e4%b8%8a%e6%90%ad%e5%bb%ba-typecho-lnmpnginx-mysql-%e5%8d%9a%e5%ae%a2-%ef%bc%88%e9%99%84php%e7%99%bd%e5%b1%8f%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.iotch.xyz\/?p=848","title":{"rendered":"\u5728Raspberry PI 3 \u4e0a\u642d\u5efa Typecho + LNMP(Nginx, MySQL) \u535a\u5ba2 \uff08\u9644PHP\u767d\u5c4f\u89e3\u51b3\u65b9\u6cd5\uff09"},"content":{"rendered":"\n<p>\u5728\u8fd9\u4e2a\u535a\u5ba2\u6700\u7ec8\u88ab\u642d\u5efa\u6210\u529f\u65f6\uff0c\u6211\u662f\u6709\u8bb8\u591a\u611f\u6168\u7684\u3002\u611f\u6168\u4e4b\u4e00\uff0c\u4f5c\u4e3a\u4e00\u4e2a\u5b66\u673a\u68b0\u51fa\u8eab\u7684\u7535\u5b50\u5de5\u7a0b\u5e08\u6765\u5b66linux\u548c\u642d\u5efa\u7b80\u5355\u7684\u7f51\u7edc\u5e94\u7528\uff0c\u9047\u5230\u7684\u9ebb\u70e6\u4e5f\u662f\u8d85\u7ea7\u591a\u7684\uff0c\u4f46\u4e5f\u662f\u7740\u5b9e\u6709\u8da3\u3002\u611f\u6168\u4e4b\u4e8c\uff0c\u6211\u7ec8\u4e8e\u53c8\u5f00\u59cb\u5199\u535a\u5ba2\u4e86\uff0c\u8fd9\u70b9\u4ee5\u540e\u518d\u8bf4\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e00\u7bc7\u6587\u7ae0\uff0c\u662f [How To] \u7cfb\u5217\u7684\uff0c\u611f\u89c9\u4e5f\u662f\u602a\u602a\u7684\uff0c\u4e5f\u8bb8\u662f\u56e0\u4e3a\u6211\u4e00\u76f4\u60f3\u5199\u4e00\u7bc7\u7c7b\u4f3c\u201c\u6211\u4ece\u54ea\u91cc\u6765\u201d\u7684\u77ed\u6587\uff1f<\/p>\n\n\n\n<p>--- \u5e9f\u8bdd\u4e0d\u591a\u8bf4 ---<\/p>\n\n\n\n<p>\u57283\u67081\u53f7\uff0c\u6811\u8393\u6d3e3\u53d1\u5e03\u7684\u7b2c\u4e8c\u5929\uff0c\u6211\u5c31\u62ff\u5230\u4e86PI3\uff0c\u4e4b\u540e\u4fbf\u4e00\u76f4\u6c89\u6d78\u5728linux\u91cc\u9762\uff1b\u8fd9\u662f\u6211\u7b2c\u4e00\u6b21\u6df1\u5165\u5730\u53bb\u63a5\u89e6\u548c\u4e86\u89e3linux\u3002<br>\u5728\u914d\u7f6e\u7684\u8fc7\u7a0b\u4e2d\uff0c\u603b\u662f\u9047\u5230\u5404\u79cd\u5404\u6837\u7684\u56f0\u96be\uff0c\u7b49\u5230\u6700\u7ec8\u4e86\u89e3\u4e86\uff0c\u89e3\u51b3\u4e86\uff0c\u56de\u8fc7\u5934\u6765\u770b\uff0c\u5176\u5b9e\u90fd\u662f\u4e00\u4e9b\u5f88\u7b80\u6d01\u660e\u4e86\u7684\u5751\u3002<br><br>--- \u5e9f\u8bdd\u4e0d\u591a\u8bf4(1) ---<\/p>\n\n\n\n<p><strong>Front References:<\/strong><br>\u4f7f\u7528\u6811\u8393\u6d3e\u642d\u5efaLNMP\u670d\u52a1\u5668\uff0c\u6210\u529f\u8fd0\u884ctypecho\u3002<br><a href=\"http:\/\/www.chinagtd.com\/archives\/lnmptypecho.html\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/www.chinagtd.com\/archives\/lnmptypecho.html<\/a><\/p>\n\n\n\n<p>\u5229\u7528raspberry pi\u642d\u5efatypecho\u7b14\u8bb0(\u4e00) nginx PHP server quick start<br><a href=\"http:\/\/www.cnblogs.com\/kururu\/p\/3536416.html\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/www.cnblogs.com\/kururu\/p\/3536416.html<\/a><\/p>\n\n\n\n<p>\u5982\u679c\u611f\u5174\u8da3\uff0c\u53ef\u4ee5\u5148\u770b\u770b\u8fd9\u4e24\u7bc7\u6211\u4e3b\u8981\u53c2\u8003\u7684\u7b14\u8bb0\uff0c\u6574\u4e2a\u8fc7\u7a0b\u90fd\u5f88\u6e05\u6670\u660e\u4e86\u4e86\u3002<br>\u6709\u4eba\u53ef\u80fd\u4f1a\u95ee\uff0c\u5927\u795e\u4eec\u7684\u7b14\u8bb0\u90fd\u5df2\u7ecf\u4ecb\u7ecd\u8fc7\u6574\u4e2a\u90e8\u7f72\u8fc7\u7a0b\u4e86\uff0c\u4e3a\u4ec0\u4e48\u6211\u8981\u5199\u8fd9\u7bc7\u6587\u7ae0\u628a\u8fd9\u4e2a\u5b89\u88c5\u8fc7\u7a0b\u518d\u8bf4\u4e00\u904d\u5462..<br>\u201c\u56e0\u4e3a\u7528\u4e0d\u4e86\uff01\u201d<\/p>\n\n\n\n<p>\u6211\u731c\u6d4b\u7684\u539f\u56e0\uff0c\u56e0\u4e3anginx\u7248\u672c\u66f4\u65b0\u4e86\uff0c\u914d\u7f6e\u6587\u4ef6\u6709\u53d8\u5316\uff0c\u6240\u4ee5\u4e0d\u80fd\u76f4\u63a5\u6309\u7167\u4ed6\u4eec\u7684\u64cd\u4f5c\u3002\u7f51\u4e0a\u627e\u5230\u7684\u6559\u7a0b\u90fd\u662f2014\u5e74\u4ee5\u524d\u7684\u3002<\/p>\n\n\n\n<p>\u6211\u7684\u7cfb\u7edf\u662f\uff1a Raspbian Jessie<br>Linux raspberrypi 4.1.20-v7+ #867 SMP Wed Mar 23 20:12:32 GMT 2016 armv7l GNU\/Linux<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">0 \u7a7a<\/h1>\n\n\n\n<p>\u5f53\u7136\uff0c\u7edd\u5927\u90e8\u5206\u201c\u6559\u7a0b\u201d\uff0c\u5728\u505a\u4efb\u4f55\u5b89\u88c5\u8f6f\u4ef6\u4e4b\u524d\uff0csudo apt-get update \u548c \u901f\u51bb\u51f9\u51f8\u4e2a\u4f53\u5965\u666e\u9b3c \uff08sudo apt-get upgrade\uff09\u90fd\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">1 \u5b89\u88c5 Nginx\uff0cMySQL \u548c php \u548c\u4e00\u4e9b\u4e71\u4e03\u516b\u7cdf\u7684<\/h1>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>sudo<\/code> <code>apt-get <\/code><code>install<\/code> <code>nginx php5-fpm php5-cgi php5-cli php5-curl php5-gd php5-mcrypt php5-mysql php5-memcache php5-gd php5-sqlite php5-cgi php5-xmlrpc mysql-server mysql-client<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u4e00\u8def\u786e\u5b9a\uff0c\u4e00\u8defyes\u3002\u5c31\u88c5\u5b8c\u4e86\u8fd9\u4e09\u548c\u4ed6\u4eec\u4f9d\u8d56\u7684\u4e1c\u4e1c\u4e86\u3002\u5177\u4f53\u54ea\u4e2a\u662f\u5e72\u561b\u7684\uff0c\u770b\u540d\u5b57\u5c31\u61c2\uff0c\u4e0d\u61c2\u4e5f\u6ca1\u4e8b\u513f\uff0c\u53cd\u6b63\u6211\u770b\u4e0d\u61c2\u3002<br>\u5982\u679c\u4f60\u662f\u7b2c\u4e00\u6b21\u88c5\uff0c\u5343\u4e07\u522b\u6025\u7740\u53bb\u4f18\u5316\u914d\u7f6e\u6587\u4ef6\u4ec0\u4e48\u7684\uff0c\u88ab\u90a3\u4e9b\u4f18\u5316\u628a\u5b89\u88c5\u7684\u8282\u594f\u4e71\u6389\u4e86\uff0c\u4eba\u5c31\u70e6\u8e81\u4e86\uff0c\u88c5\u597d\u4e86\u60f3\u8981\u4f18\u5316\u76f4\u63a5\u770b\u6587\u7ae0\u6700\u540e\u7684\u51e0\u4e2a\u5b89\u88c5\u7b14\u8bb0\u3002<\/p>\n\n\n\n<p>\u8fd9\u65f6\u5019\u6700\u5e94\u8be5\u505a\u7684\uff0c\u662f\u5728\u6d4f\u89c8\u5668\u8f93\u5165 <a href=\"http:\/\/\u4f60\u7684\u6811\u8393\u6d3eIP\u5730\u5740\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/\u4f60\u7684\u6811\u8393\u6d3eIP\u5730\u5740<\/a> \uff0c\u770b\u770bnginx\u7684\u521d\u59cb\u9875\u9762\u7684\u6837\u5b50\uff0c\u6253\u4e00\u4e0b\u9e21\u8840\u3002<br>\u767d\u5e95\u9ed1\u5b57\u7684\u771f\u5fc3\u8ddftypecho\u4e00\u6837\u7b80\u6d01\u5462\u3002<\/p>\n\n\n\n<p><strong>\u6ce8\u610f\uff1a<\/strong><br>\u6211\u7684nginx \u7248\u672c\u4e3a 1.6.2<br>\u67e5\u770b\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4<br><code>nginx -v<\/code><br>\u5982\u679c\u4f60\u7684\u7248\u672c\u662f1.2x \u90a3\u4e48\u76f4\u63a5\u4f7f\u7528\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6\uff0c\u4e0d\u4f1a\u6709php\u767d\u5c4f\u95ee\u9898\u3002\u4e0d\u9700\u8981\u6309\u6211\u5f3a\u8c03\u7684\u4fee\u6539<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">2 \u5b89\u88c5PhpMyAdmin<\/h1>\n\n\n\n<p>\u8fd9\u8d27\u662f\u7528\u6765\u7ba1\u7406\u6570\u636e\u5e93\u7684\uff0c\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u7528\u8fd9\u8d27\u64cd\u4f5c\u6570\u636e\u5e93\uff0c\u7ed9typecho \u5efa\u7acb\u4e00\u4e2a\u7528\u6237\u540d\u548c\u5bc6\u7801\uff0c\u8fd9\u6837typecho\u5c31\u80fd\u81ea\u5df1\u64cd\u4f5c\u6570\u636e\u5e93\u4e86\u3002\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u8ba9\u8f93\u5165\u6570\u636e\u5e93\u7684\u5bc6\u7801\uff0c\u4ec0\u4e48\u7684\uff0c\u6ce8\u610f\u770b\u5185\u5bb9\u9009\u62e9\u5c31\u597d\u3002\u4f46\u662f\u5f88\u5947\u602a\u8fd9\u8d27\u5728\u5b89\u88c5\u7684\u65f6\u5019\u6ca1\u6709nginx\u7684\u9009\u9879\uff0c\u6211\u9009\u7684\u662fApache2\uff0c\u4e00\u6837\u7528\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>sudo<\/code> <code>apt-get <\/code><code>install<\/code> <code>phpmyadmin<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u628a\u5b83\uff0clink\u4e00\u4e2a\u5230 \/var\/www\/html\uff0c \u4e5f\u5c31\u662f\u65b0\u7684nginx\u7684\u9ed8\u8ba4\u7f51\u9875\u6587\u4ef6\u5939\uff0c\u8fd9\u6837\u4f60\u5c31\u53ef\u4ee5\u901a\u8fc7\u7f51\u9875\uff0c\u8bbf\u95ee\u5b83\u4e86\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>sudo<\/code> <code>ln<\/code> <code>-s <\/code><code>\/usr\/share\/phpmyadmin<\/code> <code>\/var\/www\/html\/phpmyadmin<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u5e76\u4e14\u628a\u8fd9\u4e2a\u6587\u4ef6\u5939\u7684\u6743\u9650\u6539\u6210\u8c01\u90fd\u53ef\u4ee5\u8bfb\u5199\u6267\u884c\uff0c\u4e3a\u4e86\u540e\u9762\u5b89\u88c5typecho\u505a\u51c6\u5907<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>sudo<\/code> <code>chmod<\/code> <code>-R 777 <\/code><code>\/var\/www\/html<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7136\u540e\u91cd\u542f\u4e00\u4e0b<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>12<\/td><td><code>sudo<\/code> <code>php5enmod mcrypt<\/code><code>sudo<\/code> <code>service php5-fpm restart<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>*\u6ce8\u610f:<br>\u65b0\u7684nginx(\u6211\u7684\u7248\u672c 1.6.2) \u5df2\u7ecf\u5c06\u9ed8\u8ba4\u7f51\u9875\u76ee\u5f55\u653e\u5728 \/var\/www\/html \u4e86,\u5982\u679c\u4f60\u662f\u6309\u7740\u8001\u7684\u6559\u7a0b\u8fdb\u884c\u7684\u5b89\u88c5\uff0c\u8bf7\u5ffd\u7565\u4ed6\u4eec\u7684\u5173\u4e8e\u4fee\u6539\u7f51\u9875\u76ee\u5f55\u7684\u90e8\u5206*<\/p>\n\n\n\n<p>\u518d\u6253\u4e00\u4e0b\u9e21\u8840\uff1f \u5728\u6d4f\u89c8\u5668\u8f93\u5165 <a href=\"http:\/\/\u4f60\u7684\u6811\u8393\u6d3eIP\u5730\u5740\/phpmyadmin\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/\u4f60\u7684\u6811\u8393\u6d3eIP\u5730\u5740\/phpmyadmin<\/a><br>\u5e94\u8be5\u5c31\u80fd\u770b\u5230phpadmin\u7684\u767b\u5f55\u754c\u9762\u4e86\uff0c\u7528\u6237\u540d\u662froot \u5bc6\u7801\u662f\u4f60\u5728\u521a\u521a\u5b89\u88c5\u7684\u65f6\u5019\u8f93\u5165\u7684\u5bc6\u7801<br>\u5982\u679c\u770b\u5230\u7684\u662f\u4e00\u4e2a\u767d\u767d\u767dblank page\uff0c\u6ca1\u5173\u7cfb\uff0c\u6211\u4eec\u9700\u8981\u7ee7\u7eed\u8bbe\u7f6e\u4e00\u4e0bnginx\u7684\u7f51\u7ad9\u914d\u7f6e<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">3. \u914d\u7f6enginx \u7f51\u7ad9\u5c5e\u6027\u3002<\/h1>\n\n\n\n<p>\u4e3a\u561b\u6211\u8bf4\u914d\u7f6e\u7f51\u7ad9\u5c5e\u6027\uff0c\u800c\u4e0d\u662f\u914d\u7f6enginx\u5462\uff1f<br>\u56e0\u4e3a\u4e00\u4e2anginx\u662f\u53ef\u4ee5\u8dd1\u591a\u4e2a\u7f51\u7ad9\u7684\uff01 \u800c\u6309\u6559\u7a0b\u76f4\u63a5\u53bb\u914d\u7f6e \/etc\/nginx\/nginx.conf \u8fd9\u4e2a\u5168\u5c40\u914d\u7f6e\uff0c\u5c31\u662f\u5728\u6316\u5751\u7ed9\u4ee5\u540e\u7684\u4f60\u3002<strong>\u5343\u4e07\u5728\u4e0d\u4e86\u89e3\u7684\u65f6\u5019\u522b\u53bb\u52a8\u8fd9\u4e2a\u6587\u4ef6<\/strong>\u3002<\/p>\n\n\n\n<p>nginx \u6709\u9488\u5bf9\u6bcf\u4e00\u4e2a\u7f51\u7ad9\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e0b\u9762\u7684\u914d\u7f6e\uff0c\u8ddf\u5728\u5168\u5c40\u914d\u7f6e\u662f\u4e00\u6837\u7684\u3002\u8fd9\u4e9b\u6587\u4ef6\u5b58\u653e\u5728 \/etc\/nginx\/sites-available\/ \u5982\u679c\u60f3\u542f\u7528\u4ed6\u4eec\uff0c\u5c31\u5728\u9694\u58c1\u6587\u4ef6\u5939\/etc\/nginx\/sites-enable\/\u5efa\u7acb\u4e00\u4e2a\u94fe\u63a5\u6587\u4ef6\uff0c\u7136\u540e\u5c31\u53ef\u4ee5\u542f\u7528\u4e86\u3002\/etc\/nginx\/sites-enable\u4e0b\u9ed8\u8ba4\u5df2\u7ecf\u6709\u4e86\u4e00\u4e2a\u94fe\u63a5\u5230default\u7684\u6587\u4ef6\u3002\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u4fee\u6539\u6216\u8005\u91cd\u5199\/etc\/nginx\/sites-available\/default \u6765\u914d\u7f6e\u6211\u4eec\u7684\u7f51\u9875\u3002<\/p>\n\n\n\n<p>\u8fd9\u4e2adefault\u4e5f\u5f88\u73cd\u8d35\uff0c\u53ef\u4ee5\u5148\u5907\u4efd\u4e00\u4e0b<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>sudo<\/code> <code>cp<\/code> <code>\/etc\/nginx\/sites-available\/default<\/code> <code>\/etc\/nginx\/sites-available\/default<\/code><code>.backup<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u4e3a\u4e86\u5077\u61d2\uff0c\u5907\u4efd\u5b8c\u4e4b\u540e\u6211\u4eec\u628a\u5b83\u5220\u9664\uff0c\u7136\u540e\u518d\u65b0\u5efa\u540d\u79f0\u4e00\u6837\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4f5c\u4e3a\u6211\u4eec\u7f51\u7ad9\u7684\u914d\u7f6e<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>12<\/td><td><code>sudo<\/code> <code>rm<\/code> <code>-rf <\/code><code>\/etc\/nginx\/sites-available\/default<\/code><code>sudo<\/code> <code>nano <\/code><code>\/etc\/nginx\/sites-available\/default<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7136\u540e\u628a\u6211\u7684\u914d\u7f6e\u653e\u8fdb\u53bb<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n      listen 80 default_server;\n      root \/var\/www\/html;\n      index index.html index.htm index.php;\n \n      server_name aircheese.me;\n \n      location \/ {\n        if (-f $request_filename\/index.html){\n            rewrite (.*) $1\/index.html break;\n        }\n        if (-f $request_filename\/index.php){\n            rewrite (.*) $1\/index.php;\n        }\n        if (!-f $request_filename){\n            rewrite (.*) \/index.php;\n        }\n    }\n \n    location ~ .*\\.php(\\\/.*)*$ {\n    fastcgi_split_path_info ^(.+\\.php)(\/.+)$;\n    fastcgi_pass unix:\/var\/run\/php5-fpm.sock;\n    fastcgi_index index.php;\n    include fastcgi.conf;\n  }\n}<\/code><\/pre>\n\n\n\n<p>*\u7b80\u5355\u8bf4\u4e00\u4e0b\u4ee3\u7801\uff0c\u7b2c\u4e00\u4e2alocation\u4e4b\u524d\uff0c\u63cf\u8ff0\u7684\u662f\u4e00\u4e9b\u7f51\u7ad9\u7684\u5168\u5c40\u914d\u7f6e\u3002<br>\u7b2c\u4e00\u4e2a location \u662f typecho \u6253\u5f00\u6c38\u4e45\u5730\u5740\u8f6c\u6362\u9700\u8981\u7684\u91cd\u5199\u89c4\u5219\u3002\u5728\u4f60\u540e\u9762\u8bbe\u7f6e\u7684\u65f6\u5019typecho\u4f1a\u81ea\u52a8\u68c0\u6d4b\u662f\u5426\u53ef\u4ee5\u6253\u5f00\uff0c\u53ef\u80fd\u4f1a\u68c0\u6d4b\u5931\u8d25\uff0c\u4f60\u9009\u62e9\u5f3a\u5236\u6253\u5f00\u5373\u53ef\u3002<br>\u7b2c\u4e8c\u4e2a location \u662f pathinfo \u7684\u652f\u6301\uff0c\u5bf9\u4e8e typecho \u8fd9\u4e2a\u662f\u5fc5\u987b\u6709\u7684*<\/p>\n\n\n\n<p>\u6839\u636e\u4f60\u7684\u7f51\u9875\uff0c\u6709\u51e0\u4e2a\u5730\u65b9\u662f\u9700\u8981\u4fee\u6539\u7684<br>server_name \u540e\u9762\u4fee\u6539\u6210\u4f60\u7684\u57df\u540d<br>root \u9700\u8981\u786e\u8ba4\u662f\u5426\u662f\u4f60\u7684\u7f51\u7ad9\u76ee\u5f55\uff08\u5982\u679c\u4f60\u6309\u6211\u7684\u6559\u7a0b\uff0c\u8fd9\u4e2a\u5730\u65b9\u5e94\u8be5\u4e0d\u7528\u6539\u7684\uff09<br>listen 80 \u5982\u679c\u4f60\u768480\u7aef\u53e3\u88ab\u5c01\u4e86\uff0c\u4f60\u9700\u8981\u6309\u5176\u4ed6\u6559\u7a0b\u7684\u6539\u621081\u6216\u80058080<\/p>\n\n\n\n<p>\u4fdd\u5b58\u540e\uff0c\u91cd\u542fnginx\u670d\u52a1\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528\u65b0\u7684\u914d\u7f6e\u4e86<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>sudo<\/code> <code>service nginx restart<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7531\u4e8e\u4e00\u4e9b\u5217\u5386\u53f2\u539f\u56e0\uff0c\u5982\u679c\u4f60\u6309\u7167\u4e4b\u524d\u7684\u914d\u7f6e\u7b14\u8bb0\u53bb\u914d\u7f6enginx\uff0c\u90a3\u4f60\u6709\u5f88\u5927\u7684\u51e0\u7387\u4f1a\u51fa\u73b0\u4e0a\u9762\u63d0\u5230\u7684php\u9875\u9762\u662f\u767d\u5c4f\u3002<br>\u800c\u8fd9\u4e2a\u539f\u56e0\uff0c\u662f\u56e0\u4e3a\u4e0a\u9762\u914d\u7f6e\u7684\u6700\u540e\u4e00\u4e2a\u8bed\u53e5\uff1ainclude fastcgi.conf; \u5728\u51e0\u4e4e\u6240\u6709\u7684\u6559\u7a0b\u91cc\u9762\u90fd\u4f7f\u7528include fastcgi_params; \u3002fastcgi_params\u76f8\u6bd4include fastcgi.conf;\u5c11\u4e86\u4e00\u6761\u8def\u5f84\u7684\u5b9a\u4e49\u3002<br><em>\u8fd9\u90e8\u5206\u5177\u4f53\u8bf7\u770b\uff1a <a href=\"http:\/\/stackoverflow.com\/questions\/15423500\/nginx-showing-blank-php-pages\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/stackoverflow.com\/questions\/15423500\/nginx-showing-blank-php-pages<\/a><\/em><\/p>\n\n\n\n<p>\u5230\u8fd9\u91cc\uff0c\u4f60\u53ef\u4ee5\u6309\u5176\u4ed6\u6559\u7a0b\uff0c\u5199\u4e00\u4e2ainfo.php \u6765\u6d4b\u8bd5\u4f60\u7684\u7f51\u9875\u662f\u5426\u5de5\u4f5c\u4e86\u3002<\/p>\n\n\n\n<p>\u5728\/var\/www\/html\/ \u76ee\u5f55\u4e0b\u521b\u5efainfo.php\uff0c\u590d\u5236\u4e0b\u9762\u7684\u8fdb\u53bb\uff0c\u7136\u540e\u4fdd\u5b58\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><\/td><td><code>&lt;?php<\/code><code>phpinfo();<\/code><code>?&gt;<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7136\u540e\u6d4f\u89c8\u5668\u8bbf\u95ee <a href=\"http:\/\/\u4f60\u7684\u6811\u8393\u6d3eip\u5730\u5740\/info.php\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/\u4f60\u7684\u6811\u8393\u6d3eip\u5730\u5740\/info.php<\/a> \u5982\u679c\u51fa\u6765\u7684\u4e0d\u662f\u767d\u7f51\u9875\uff0c\u4f60\u5c31\u53ef\u4ee5\u4e50\u5475\u5475\u5566\u3002\u5982\u679c\u8fd8\u662f\u767d\uff0c\u8bf7\u53c2\u7167\u4e0a\u9762\u94fe\u63a5\uff0c\u6808\u6ea2\u51fa\uff08stackoverflow\uff09\u91cc\u9762\u7684\u5176\u4ed6\u89e3\u6cd5<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">4 \u5b89\u88c5 typecho<\/h1>\n\n\n\n<p>\u8fd8\u8bb0\u5f97\u6211\u4eec\u5728 \u5b89\u88c5PhpMyAdmin \u7684\u65f6\u5019\u628a phpmyadmin \u94fe\u63a5\u5230 \/var\/www\/html\u91cc\u9762\u4e48\uff1f \u5b89\u88c5typecho\u5176\u5b9e\u4e5f\u662f\u4e00\u6837\u7684\uff0c\u6211\u4eec\u8981\u505a\u7684\uff0c\u5c31\u662f\u628atypecho \u4e0b\u8f7d\u4e0b\u6765 \uff08<a href=\"http:\/\/typecho.org\/download\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/typecho.org\/download<\/a>\uff09\uff0c\u7136\u540e\u89e3\u538b\u7f29\u5230html\u91cc\u9762\u3002\u7136\u540e\u901a\u8fc7\u5230\u5730\u5740\uff1a <a href=\"http:\/\/\u4f60\u7684\u6811\u8393\u6d3eIP\u5730\u5740\/install.php\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/\u4f60\u7684\u6811\u8393\u6d3eIP\u5730\u5740\/install.php<\/a> \u5c31\u80fd\u770b\u5230typecho\u7684\u5b89\u88c5\u754c\u9762\u4e86\u3002<\/p>\n\n\n\n<p>\u6bd4\u5982\uff0c\u6211\u7684typecho\u4e0b\u8f7d\u5728 \/home\/pi\/build.tar.gz \u6211\u8981\u628a\u5b83\u89e3\u538b\u5230\/var\/www\/html\u91cc\u9762<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>12<\/td><td><code>cd<\/code> <code>\/var\/www\/html<\/code><code>tar<\/code> <code>-xzvf <\/code><code>\/home\/pi\/build<\/code><code>.<\/code><code>tar<\/code><code>.gz<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7136\u540e\u4ed6\u4eec\u5c31\u90fd\u5230 \/var\/www\/html\/build \u91cc\u9762\u4e86\u3002\u90a3\u600e\u4e48\u628a\u6587\u4ef6\u90fd\u79fb\u52a8\u51fa\u6765\u5462\uff1f\u8fdb\u5230build\u91cc\u9762\u7528 mv <em>..\/\u5c31\u53ef\u4ee5\u4e86\u3002 <\/em>\u4ee3\u8868\u5168\u90e8\u6587\u4ef6\u548c\u6587\u4ef6\u5939 ..\/\u4ee3\u8868\u4e0a\u4e00\u7ea7\u76ee\u5f55<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>12<\/td><td><code>cd<\/code> <code>build<\/code><code>mv<\/code> <code>* ..\/<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7136\u540e\u91cd\u542f\u4e00\u4e0bnginx (\u6211\u4e0d\u6e05\u695a\u662f\u4e0d\u662f\u9700\u8981\u91cd\u542f)<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td><code>sudo<\/code> <code>service nginx restart<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7136\u540e\u901a\u8fc7\u5230\u5730\u5740\uff1a <a href=\"http:\/\/\u4f60\u7684\u6811\u8393\u6d3eIP\u5730\u5740\/install.php\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/\u4f60\u7684\u6811\u8393\u6d3eIP\u5730\u5740\/install.php<\/a> \u5e94\u8be5\u5c31\u80fd\u770b\u5230typecho\u7684\u5b89\u88c5\u754c\u9762\u4e86\u3002<br>\u7b49\u4f60\u770b\u5230\u5b89\u88c5\u9875\u9762\uff0c\u8fd9\u7bc7\u6587\u6863\u4e5f\u5e94\u8be5\u7ed3\u675f\u5b83\u6ef4\u4f7f\u547d\u5566<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><strong>PS\uff1a<\/strong><br>\u535a\u5ba2\u7684\u5b89\u88c5\uff0c\u548c\u94fe\u63a5\u5230\u6570\u636e\u5e93\uff0c\u8fd9\u7bc7\u6559\u7a0b\u5f88\u6e05\u695a\u4e86\u3002<br>\u7ad9\u957f\u767e\u79d1\uff1aTypecho \u5b89\u88c5\u6559\u7a0b<br><a href=\"http:\/\/www.zzbaike.com\/wiki\/Typecho_%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/www.zzbaike.com\/wiki\/Typecho_%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B<\/a><\/p>\n\n\n\n<p><strong>PS(1):<\/strong><br>\u8bf4\u5230\u6570\u636e\u5e93\uff0c\u4f60\u4e5f\u53ef\u4ee5\u5efa\u7acb\u4e00\u4e2a\u7528\u6237\u7ed9typecho\u7528\uff0c\u6211\u4e5f\u63a8\u8350\u8fd9\u6837\u3002\u6700\u597d\u4e0d\u8981\u76f4\u63a5root\u8d26\u6237\u3002<\/p>\n\n\n\n<p><strong>PS(2):<\/strong><br>\u4ec0\u4e48\uff0c\u4f60\u6ca1\u88c5\u6210\u529f\uff1f\u4f60\u4e0d\u5e72\u4e86\uff1f\u60f3\u5378\u8f7d\u4e48\uff1f\u522b\u627e\u6211\uff0c\u6211\u4e5f\u4e0d\u61c2\u600e\u4e48\u5378\u8f7d\u90a3\u4e00\u5806\u4e1c\u897f\uff0c\u8c01\u53eb\u4f60\u5f00\u59cb\u4e4b\u524d\u6ca1\u6709\u5168\u76d8\u955c\u50cf\u5907\u4efd\u3002\u3002<\/p>\n\n\n\n<p><strong>PS(3):<\/strong><br>\u9664\u4e86\u5728\u5f00\u59cb\u4e4b\u524d\u63a8\u8350\u7684\u4e24\u7bc7\u6559\u7a0b\u4ee5\u5916\uff0c\u5176\u4ed6\u6211\u89c9\u5f97\u5f88\u6709\u7528\u7684\u6587\u7ae0<br>\u6211\u7684\u6811\u8393\u6d3e\u73a9\u673a\u653b\u7565\u2014\u642d\u5efanginx+mysql+php\uff08\u4f18\u5316\u53c2\u8003\uff0c\u5f00\u542fgzip\uff0c\u5207\u4e0d\u53ef\u76f4\u63a5\u590d\u5236\u4ed6\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4e0d\u7136\u7b49\u7740\u767d\uff09<br><a href=\"http:\/\/blog.chensibo.com\/i-work-for-nginx-mysql-php-raiders-build-raspberry-pi\/\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/blog.chensibo.com\/i-work-for-nginx-mysql-php-raiders-build-raspberry-pi\/<\/a><\/p>\n\n\n\n<p>Raspberry PI\u6811\u8393\u6d3e\u642d\u5efaLNMP\u73af\u5883\u8dd1Typecho\uff08\u5e74\u4ee3\u4e45\u8fdc\uff0c\u4ec5\u4f9b\u53c2\u8003\uff09<br><a href=\"http:\/\/raspiweb.ch\/post-13.htm\/comment-page-2\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/raspiweb.ch\/post-13.htm\/comment-page-2<\/a><\/p>\n\n\n\n<p>\u5229\u7528raspberry pi\u642d\u5efatypecho\u7b14\u8bb0(\u4e09) typecho nginx sqlite FAQ\uff08\u5982\u679c\u9047\u5230\u9519\u8bef\uff0c\u8bf7\u53c2\u7167\u8fd9\u7bc7\uff0c\u4e0d\u53ef\u76f4\u63a5\u590d\u5236\u4ed6\u7684\u914d\u7f6e\uff0c\u540c\u6837\u7b49\u767d\uff09<br><a href=\"http:\/\/www.cnblogs.com\/kururu\/p\/3536626.html\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/www.cnblogs.com\/kururu\/p\/3536626.html<\/a><\/p>\n\n\n\n<p>Typecho\u5b98\u65b9\u6587\u6863\u6709\u5173\u4e8enginx\u7684\u914d\u7f6e\uff0c\u53ef\u4f9b\u53c2\u8003<br><a href=\"http:\/\/docs.typecho.org\/servers?s\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/docs.typecho.org\/servers?s<\/a>[]=nginx<\/p>\n\n\n\n<p><strong>PS(4) :<\/strong><br>\u6211\u7684default\u914d\u7f6e\uff0c\u52a0\u5165\u4e86gzip\u7f51\u9875\u538b\u7f29\uff0c\u4fee\u6539\u81ea <a href=\"https:\/\/loftor.com\/archives\/typecho_nginx_conf.html\" target=\"_blank\"  rel=\"nofollow\" >https:\/\/loftor.com\/archives\/typecho_nginx_conf.html<\/a> \u4ec5\u4f9b\u53c2\u8003\u3002\u539f\u6587\u7684 include fastcgi_params;\u9700\u8981\u4fee\u6539\u4e3ainclude fastcgi.conf; \u5373\u53ef\u89e3\u51b3php\u767d\u95ee\u9898\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n  listen 80 default_server;\n  root \/var\/www\/html;\n  index index.html index.htm index.php;\n \n  gzip on;\n    gzip_min_length 1k;\n    gzip_buffers 16 64k;\n    gzip_http_version 1.1;\n    gzip_comp_level 6;\n    gzip_types text\/plain application\/x-javascript text\/css application\/xml;\n    gzip_vary on;\n \n  server_name aircheese.me;\n \n  location \/ {\n        if (-f $request_filename\/index.html){\n            rewrite (.*) $1\/index.html break;\n        }\n        if (-f $request_filename\/index.php){\n            rewrite (.*) $1\/index.php;\n        }\n        if (!-f $request_filename){\n            rewrite (.*) \/index.php;\n        }\n    }\n \n \n  location ~ .*\\.php(\\\/.*)*$ {\n    fastcgi_split_path_info ^(.+\\.php)(\/.+)$;\n    fastcgi_pass unix:\/var\/run\/php5-fpm.sock;\n    fastcgi_index index.php;\n    include fastcgi.conf;\n  }\n}<\/code><\/pre>\n\n\n\n<p>\u539f\u6587\u94fe\u63a5\uff1a<a href=\"http:\/\/aircheese.me\/2016\/typecho-lnmp-raspberry-pi3.html\" target=\"_blank\" rel=\"noreferrer noopener\" rel=\"nofollow\" >http:\/\/aircheese.me\/2016\/typecho-lnmp-raspberry-pi3.html<\/a><\/p>\n<button class=\"simplefavorite-button\" data-postid=\"848\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>\u5728\u8fd9\u4e2a\u535a\u5ba2\u6700\u7ec8\u88ab\u642d\u5efa\u6210\u529f\u65f6\uff0c\u6211\u662f\u6709\u8bb8\u591a\u611f\u6168\u7684\u3002\u611f\u6168\u4e4b\u4e00\uff0c\u4f5c\u4e3a\u4e00\u4e2a\u5b66\u673a\u68b0\u51fa\u8eab\u7684\u7535\u5b50\u5de5\u7a0b\u5e08\u6765\u5b66linux\u548c\u642d\u5efa\u7b80\u5355\u7684\u7f51\u7edc\u5e94\u7528\uff0c\u9047\u5230\u7684\u9ebb &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-848","post","type-post","status-publish","format-standard","hentry","category-10"],"_links":{"self":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/848","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=848"}],"version-history":[{"count":0,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=\/wp\/v2\/posts\/848\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iotch.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}