{"id":44956,"date":"2024-10-06T19:26:14","date_gmt":"2024-10-06T11:26:14","guid":{"rendered":"https:\/\/server.hk\/cnblog\/44956\/"},"modified":"2024-10-06T19:26:14","modified_gmt":"2024-10-06T11:26:14","slug":"linux-%e4%b8%8b%e6%8c%87%e5%ae%9a%e7%89%88%e6%9c%ac%e7%b7%a8%e8%ad%af%e5%ae%89%e8%a3%9d-lamp","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/44956\/","title":{"rendered":"Linux \u4e0b\u6307\u5b9a\u7248\u672c\u7de8\u8b6f\u5b89\u88dd LAMP"},"content":{"rendered":"<h1 id=\"linux-%e4%b8%8b%e6%8c%87%e5%ae%9a%e7%89%88%e6%9c%ac%e7%b7%a8%e8%ad%af%e5%ae%89%e8%a3%9d-lamp-wYQBZjbvYF\">Linux \u4e0b\u6307\u5b9a\u7248\u672c\u7de8\u8b6f\u5b89\u88dd LAMP<\/h1>\n<p>LAMP \u662f\u4e00\u500b\u5ee3\u6cdb\u4f7f\u7528\u7684\u958b\u6e90\u8edf\u9ad4\u5806\u758a\uff0c\u901a\u5e38\u7528\u65bc\u7db2\u9801\u4f3a\u670d\u5668\u7684\u642d\u5efa\u3002LAMP \u4ee3\u8868 Linux\u3001Apache\u3001MySQL \u548c PHP\u3002\u9019\u7bc7\u6587\u7ae0\u5c07\u6307\u5c0e\u60a8\u5982\u4f55\u5728 Linux \u7cfb\u7d71\u4e0a\u7de8\u8b6f\u548c\u5b89\u88dd\u6307\u5b9a\u7248\u672c\u7684 LAMP \u5806\u758a\u3002<\/p>\n<h2 id=\"%e7%92%b0%e5%a2%83%e6%ba%96%e5%82%99-wYQBZjbvYF\">\u74b0\u5883\u6e96\u5099<\/h2>\n<p>\u5728\u958b\u59cb\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u78ba\u4fdd\u60a8\u7684 Linux \u7cfb\u7d71\u5df2\u7d93\u5b89\u88dd\u4e86\u5fc5\u8981\u7684\u958b\u767c\u5de5\u5177\u548c\u5eab\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u5b89\u88dd\u9019\u4e9b\u5de5\u5177\uff1a<\/p>\n<pre><code>sudo apt update\nsudo apt install build-essential libxml2-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libmysqlclient-dev<\/code><\/pre>\n<h2 id=\"%e5%ae%89%e8%a3%9d-apache-wYQBZjbvYF\">\u5b89\u88dd Apache<\/h2>\n<p>\u9996\u5148\uff0c\u6211\u5011\u9700\u8981\u5b89\u88dd Apache \u7db2\u9801\u4f3a\u670d\u5668\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd\u6307\u5b9a\u7248\u672c Apache \u7684\u6b65\u9a5f\uff1a<\/p>\n<pre><code>cd \/usr\/local\/src\nwget https:\/\/downloads.apache.org\/httpd\/httpd-2.4.51.tar.gz\ntar -zxvf httpd-2.4.51.tar.gz\ncd httpd-2.4.51\n.\/configure --prefix=\/usr\/local\/apache2\nmake\nsudo make install<\/code><\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u555f\u52d5 Apache\uff1a<\/p>\n<pre><code>\/usr\/local\/apache2\/bin\/apachectl start<\/code><\/pre>\n<h2 id=\"%e5%ae%89%e8%a3%9d-mysql-wYQBZjbvYF\">\u5b89\u88dd MySQL<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u6211\u5011\u5c07\u5b89\u88dd MySQL\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd\u6307\u5b9a\u7248\u672c MySQL \u7684\u6b65\u9a5f\uff1a<\/p>\n<pre><code>cd \/usr\/local\/src\nwget https:\/\/dev.mysql.com\/get\/Downloads\/MySQL-8.0\/mysql-8.0.26.tar.gz\ntar -zxvf mysql-8.0.26.tar.gz\ncd mysql-8.0.26\ncmake . -DDOWNLOAD_BOOST=1 -DWITH_BOOST=boost\nmake\nsudo make install<\/code><\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u9700\u8981\u521d\u59cb\u5316 MySQL \u6578\u64da\u5eab\uff1a<\/p>\n<pre><code>sudo \/usr\/local\/mysql\/bin\/mysqld --initialize --user=mysql<\/code><\/pre>\n<h2 id=\"%e5%ae%89%e8%a3%9d-php-wYQBZjbvYF\">\u5b89\u88dd PHP<\/h2>\n<p>\u6700\u5f8c\uff0c\u6211\u5011\u5c07\u5b89\u88dd PHP\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd\u6307\u5b9a\u7248\u672c PHP \u7684\u6b65\u9a5f\uff1a<\/p>\n<pre><code>cd \/usr\/local\/src\nwget https:\/\/www.php.net\/distributions\/php-8.0.10.tar.gz\ntar -zxvf php-8.0.10.tar.gz\ncd php-8.0.10\n.\/configure --with-apxs2=\/usr\/local\/apache2\/bin\/apxs --with-mysqli --with-curl --with-gd\nmake\nsudo make install<\/code><\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u5275\u5efa\u4e00\u500b PHP \u6e2c\u8a66\u6587\u4ef6\u4f86\u78ba\u8a8d PHP \u662f\u5426\u6b63\u5e38\u904b\u884c\uff1a<\/p>\n<pre><code>echo \"&lt;?php phpinfo(); ?&gt;\" | sudo tee \/usr\/local\/apache2\/htdocs\/info.php<\/code><\/pre>\n<p>\u7136\u5f8c\uff0c\u60a8\u53ef\u4ee5\u5728\u700f\u89bd\u5668\u4e2d\u8a2a\u554f <a href=\"http:\/\/localhost\/info.php\" rel=\"nofollow noopener\" target=\"_blank\">http:\/\/localhost\/info.php<\/a> \u4f86\u67e5\u770b PHP \u7684\u4fe1\u606f\u9801\u9762\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-wYQBZjbvYF\">\u7e3d\u7d50<\/h2>\n<p>\u5728\u9019\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u5011\u4ecb\u7d39\u4e86\u5982\u4f55\u5728 Linux \u7cfb\u7d71\u4e0a\u7de8\u8b6f\u548c\u5b89\u88dd\u6307\u5b9a\u7248\u672c\u7684 LAMP \u5806\u758a\u3002\u9019\u500b\u904e\u7a0b\u6d89\u53ca\u5230 Apache\u3001MySQL \u548c PHP \u7684\u5b89\u88dd\uff0c\u4e26\u4e14\u63d0\u4f9b\u4e86\u8a73\u7d30\u7684\u6b65\u9a5f\u548c\u547d\u4ee4\u3002\u82e5\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u7684\u89e3\u6c7a\u65b9\u6848\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u4f86\u642d\u5efa\u60a8\u7684\u4f3a\u670d\u5668\u74b0\u5883\uff0c\u9019\u6a23\u53ef\u4ee5\u7bc0\u7701\u6642\u9593\u4e26\u63d0\u9ad8\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728 Linux \u4e0a\u6307\u5b9a\u7248\u672c\u7de8\u8b6f\u5b89\u88dd LAMP\uff0c\u63d0\u5347\u7db2\u7ad9\u6027\u80fd\u8207\u5b89\u5168\u6027\uff0c\u7c21\u5316\u958b\u767c\u74b0\u5883\u914d\u7f6e\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-44956","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/44956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=44956"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/44956\/revisions"}],"predecessor-version":[{"id":44957,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/44956\/revisions\/44957"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=44956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=44956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=44956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}