{"id":1148,"date":"2022-03-25T08:05:50","date_gmt":"2022-03-25T00:05:50","guid":{"rendered":"https:\/\/104.es\/?p=1148"},"modified":"2022-03-25T08:05:50","modified_gmt":"2022-03-25T00:05:50","slug":"raspberry-lamp-installation","status":"publish","type":"post","link":"https:\/\/104.es\/index.php\/2022\/03\/25\/raspberry-lamp-installation\/","title":{"rendered":"\u5728\u6a39\u8393\u6d3e\u4e0a\u5b89\u88ddLAMP\u57f7\u884c\u74b0\u5883"},"content":{"rendered":"\n<p>\u5982\u679c\u6211\u5011\u60f3\u8981\u8b93\u6a39\u8393\u6d3e\u53ef\u4ee5\u4f5c\u70ba\u4e00\u53f0\u7db2\u9801\u4f3a\u670d\u5668\u7684\u8a71\uff0c\u90a3\u9ebc\u5c31\u9700\u8981\u5728\u4e0a\u9762\u5b89\u88ddLAMP\u74b0\u5883\uff0c\u4e5f\u5c31\u662fLinux + Apache2 + MySQL Server + PHP\u3002\u672c\u7bc7\u8a18\u9304\u4e86\u5b89\u88ddLAMP\u7684\u4e00\u4e9b\u6307\u4ee4\u53ca\u8a2d\u5b9a\u6b65\u9a5f\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u8981\u66f4\u65b0\u4e00\u4e0b\u7cfb\u7d71\u7684\u5957\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update \nsudo apt upgrade -y<\/code><\/pre>\n\n\n\n<p>\u63a5\u8457\u5b89\u88dd\u7db2\u9801\u4f3a\u670d\u5668Apache2\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install apache2 -y<\/code><\/pre>\n\n\n\n<p>\u5b89\u88dd\u5b8c\u6210\u4e4b\u5f8c\uff0c\u5373\u53ef\u5229\u7528ip a\u67e5\u8a62\u6a39\u8393\u6d3e\u7684\u7db2\u5740\uff0c\u7136\u5f8c\u5229\u7528\u540c\u4e00\u500b\u7db2\u8def\u5340\u6bb5\u7684Windows\u96fb\u8166\u6216\u662f\u5728\u6a39\u8393\u6d3e\u81ea\u5df1\u7684\u684c\u9762\u700f\u89bd\u5668\u4e2d\u9032\u884c\u700f\u89bd\uff0c\u770b\u5230\u4ee5\u4e0b\u7684\u756b\u9762\u5373\u8868\u793a\u5b89\u88dd\u7121\u8aa4\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"942\" height=\"817\" src=\"http:\/\/104es.nkust.org\/wp-content\/uploads\/2022\/03\/image-11.png?w=942\" alt=\"\" class=\"wp-image-1152\" srcset=\"https:\/\/104.es\/wp-content\/uploads\/2022\/03\/image-11.png 942w, https:\/\/104.es\/wp-content\/uploads\/2022\/03\/image-11-300x260.png 300w, https:\/\/104.es\/wp-content\/uploads\/2022\/03\/image-11-768x666.png 768w\" sizes=\"auto, (max-width: 942px) 100vw, 942px\" \/><\/figure>\n\n\n\n<p>\u63a5\u4e0b\u4f86\u662fMySQL Server\u7684\u5b89\u88dd\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install mariadb-server-10.0<\/code><\/pre>\n\n\n\n<p>\u5b89\u88dd\u5b8c\u7562\u4e4b\u5f8c\u5229\u7528\u4ee5\u4e0b\u7684\u6307\u4ee4\u9032\u884c\u5b89\u5168\u8a2d\u5b9a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mysql_secure_installation<\/code><\/pre>\n\n\n\n<p>\u4e0a\u9762\u7684\u5b89\u5168\u8a2d\u5b9a\u4e2d\u7528\u4f86\u8a2d\u5b9aroot\u7684\u5bc6\u78bc\uff0c\u4ee5\u53ca\u6c7a\u5b9a\u662f\u5426\u8b93\u6b64\u8cc7\u6599\u5eab\u4f3a\u670d\u5668\u53ef\u4ee5\u5728\u9060\u7aef\u9032\u884c\u9023\u7dda\u3002\u53e6\u5916\uff0c\u5b83\u4e5f\u6703\u8a62\u554f\u662f\u5426\u9700\u8981\u79fb\u9664\u6e2c\u8a66\u7528\u7684\u8cc7\u6599\u5eab\u3002<\/p>\n\n\n\n<p>\u4e0b\u4e00\u6b65\u662f\u5b89\u88ddPHP\uff0c\u6211\u5011\u53c3\u8003<a href=\"https:\/\/www.cloudbooklet.com\/how-to-install-lamp-apache-mysql-php-in-ubuntu-20-04\/\">\u9019\u500b\u7db2\u9801<\/a>\u4e0a\u7684\u8aaa\u660e\uff0c\u5118\u91cf\u628a\u6240\u6709\u7684PHP\u6240\u9700\u8981\u7684\u6a21\u7d44\u90fd\u88dd\u4e0a\u53bb\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install php libapache2-mod-php php7.4-mysql php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y <\/code><\/pre>\n\n\n\n<p>PHP\u5b89\u88dd\u5b8c\u6210\u4e4b\u5f8c\uff0c\u53ef\u4ee5\u5229\u7528\u4ee5\u4e0b\u7684\u6307\u4ee4\u6aa2\u67e5PHP\u7684\u7248\u672c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php -v<\/code><\/pre>\n\n\n\n<p>\u6b64\u6642\u61c9\u53ef\u4ee5\u770b\u5230\u5982\u4e0b\u6240\u793a\u7684\u756b\u9762\u8a0a\u606f\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"926\" height=\"143\" src=\"http:\/\/104es.nkust.org\/wp-content\/uploads\/2022\/03\/image-12.png?w=926\" alt=\"\" class=\"wp-image-1157\" srcset=\"https:\/\/104.es\/wp-content\/uploads\/2022\/03\/image-12.png 926w, https:\/\/104.es\/wp-content\/uploads\/2022\/03\/image-12-300x46.png 300w, https:\/\/104.es\/wp-content\/uploads\/2022\/03\/image-12-768x119.png 768w\" sizes=\"auto, (max-width: 926px) 100vw, 926px\" \/><\/figure>\n\n\n\n<p>\u5728\/etc\/php\/7.4\/apache2\u8cc7\u6599\u593e\u4e0b\u6709\u4e00\u500b\u53eb\u505aphp.ini\u7684\u8a2d\u5b9a\u6a94\uff0c\u5728\u5176\u4e2d\u53ef\u4ee5\u8abf\u6574\u4e00\u4e9bPHP\u7684\u7cfb\u7d71\u53c3\u6578\uff0c\u4f8b\u5982\u60f3\u8981\u8b93\u53ef\u4e0a\u50b3\u7684\u6a94\u6848\u5927\u5c0f\u8b8a\u5927\uff0c\u53ef\u8abf\u6574upload_max_filesize\uff0c\u8981\u5ef6\u9577PHP\u7a0b\u5f0f\u53ef\u57f7\u884c\u6642\u9593\uff0c\u5247\u9700\u8abf\u6574max_execution_time\u7b49\u7b49\uff0c\u8acb\u4f9d\u7167\u81ea\u8eab\u7684\u9700\u6c42\u9032\u884c\u8abf\u6574\u3002\u8abf\u6574\u5b8c\u7562\u4e4b\u5f8c\uff0c\u53ef\u5229\u7528\u4ee5\u4e0b\u7684\u6307\u4ee4\u91cd\u555fApache2\uff0c\u8b93\u8abf\u6574\u7684\u8a2d\u5b9a\u53ef\u4ee5\u751f\u6548\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo service apache2 restart<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8ff0\u6b65\u9a5f\u90fd\u5b8c\u6210\u4e4b\u5f8c\uff0c\u5373\u53ef\u5728\/var\/www\/html\u7de8\u5beb\u4f60\u7684\u7db2\u7ad9\uff0c\u4ee5\u4e0b\u662fPHP\u7cfb\u7d71\u7d44\u614b\u986f\u793a\u7684\u7db2\u9801\u4f8b(\u8acb\u628a\u4ee5\u4e0b\u7684\u7a0b\u5f0f\u78bc\u5132\u5b58\u70baindex.php\uff0c\u4e26\u522a\u9664\u539f\u6709\u7684index.html\u6a94\u6848)\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\nphpinfo();\n?&gt;<\/code><\/pre>\n\n\n\n<p>\u4ee5\u4e0b\u5373\u70ba\u91cd\u65b0\u6574\u7406\u7db2\u9801\u4e4b\u5f8c\u770b\u5230\u7684\u7d50\u679c\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"942\" height=\"817\" src=\"http:\/\/104es.nkust.org\/wp-content\/uploads\/2022\/03\/image-13.png?w=942\" alt=\"\" class=\"wp-image-1159\" srcset=\"https:\/\/104.es\/wp-content\/uploads\/2022\/03\/image-13.png 942w, https:\/\/104.es\/wp-content\/uploads\/2022\/03\/image-13-300x260.png 300w, https:\/\/104.es\/wp-content\/uploads\/2022\/03\/image-13-768x666.png 768w\" sizes=\"auto, (max-width: 942px) 100vw, 942px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u6211\u5011\u60f3\u8981\u8b93\u6a39\u8393\u6d3e\u53ef\u4ee5\u4f5c\u70ba\u4e00\u53f0\u7db2\u9801\u4f3a\u670d\u5668\u7684\u8a71\uff0c\u90a3\u9ebc\u5c31\u9700\u8981\u5728\u4e0a\u9762\u5b89\u88ddLAMP\u74b0\u5883\uff0c\u4e5f\u5c31\u662fLinux + Apache2 + MySQL Server + PHP\u3002\u672c\u7bc7\u8a18\u9304\u4e86\u5b89\u88ddLAMP\u7684\u4e00\u4e9b\u6307\u4ee4\u53ca\u8a2d\u5b9a\u6b65\u9a5f\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[14,17],"tags":[],"class_list":["post-1148","post","type-post","status-publish","format-standard","hentry","category-php","category-raspberry-pi"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts\/1148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/comments?post=1148"}],"version-history":[{"count":0,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts\/1148\/revisions"}],"wp:attachment":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/media?parent=1148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/categories?post=1148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/tags?post=1148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}