{"id":1539,"date":"2022-03-01T13:48:06","date_gmt":"2022-03-01T05:48:06","guid":{"rendered":"https:\/\/dasmz.com\/?p=1539"},"modified":"2022-03-01T16:37:24","modified_gmt":"2022-03-01T08:37:24","slug":"%e7%b3%bb%e7%bb%9f%e7%8e%af%e5%a2%83ubuntu-20-04-lts%ef%bc%8c%e7%bc%96%e8%af%91%e5%ae%89%e8%a3%85php","status":"publish","type":"post","link":"https:\/\/dasmz.com\/?p=1539","title":{"rendered":"\u7cfb\u7edf\u73af\u5883Ubuntu 20.04\u6216\u8005Debian 10\uff0c\u5b89\u88c5php 7.4\u7248\u672c 2022-03-01"},"content":{"rendered":"\n<p>\u9700\u6c42<\/p>\n\n\n\n<p>\u4e3a\u4e86\u8854\u63a5Nginx\u548cMySQL\u6570\u636e\u5e93\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5php<\/p>\n\n\n\n<p>Nginx\u6ca1\u6709\u5185\u5728\u652f\u6301php\uff0c\u6545\u800c\uff0c\u6211\u4eec\u9700\u8981PHP-FPM (\u201cfastCGI process manager\u201d)\u6765\u9a71\u52a8\u5b83<\/p>\n\n\n\n<p>\u90e8\u7f72\u5b9e\u65bd<\/p>\n\n\n\n<p>\u66f4\u65b0\u5305\u6e05\u5355<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt update<\/pre>\n\n\n\n<p>\u5b89\u88c5<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt install php-fpm<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ Ubuntu 20.04.4 LTS \u5b89\u88c5\u7684\u65e5\u5fd7\u8bb0\u5f55 2022-3-1\n<em>The following additional packages will be installed:\n  php-common php7.4-cli php7.4-common php7.4-fpm php7.4-json php7.4-opcache\n  php7.4-readline\nSuggested packages:\n  php-pear\nThe following NEW packages will be installed:\n  php-common php-fpm php7.4-cli php7.4-common php7.4-fpm php7.4-json\n  php7.4-opcache php7.4-readline\n0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.\nNeed to get 4,080 kB of archives.\nAfter this operation, 18.1 MB of additional disk space will be used.\nDo you want to continue? [Y\/n] <\/em><strong>Y<\/strong><em>\n...<\/em>\n<em>Setting up php-fpm (2:7.4+75) ...\nProcessing triggers for man-db (2.9.1-1) ...\nProcessing triggers for systemd (245.4-4ubuntu3.15) ...\nProcessing triggers for php7.4-cli (7.4.3-4ubuntu2.9) ...\nProcessing triggers for php7.4-fpm (7.4.3-4ubuntu2.9) ...<\/em>\n<em>\n<\/em><\/pre>\n\n\n\n<p>\u67e5\u770b\u670d\u52a1\u7684\u72b6\u6001<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl status php7.4-fpm<\/pre>\n\n\n\n<p>\u589e\u52a0\u4fee\u6539\u5bf9\u4e8eNginx\u7684\u8854\u63a5<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">server {\n\n    # . . . other code\n\n    location ~ \\.php$ {\n        include snippets\/fastcgi-php.conf;\n        fastcgi_pass unix:\/run\/php\/php7.4-fpm.sock;\n    }\n}<\/pre>\n\n\n\n<p>\u91cd\u542f\u670d\u52a1<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl restart nginx<\/pre>\n\n\n\n<p>\u5b89\u88c5\u6269\u5c55\u6a21\u5757\uff0c\u6bd4\u5982MySQL\u652f\u6301\u7684\u6a21\u5757<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt install php-mysql <\/pre>\n\n\n\n<p>\u5b89\u88c5\u6269\u5c55\u6a21\u5757\uff0c\u6bd4\u5982\u56fe\u7247\u7684\u6a21\u5757<\/p>\n\n\n\n<p><em>GD is an open source code library for the dynamic creation of images. GD is used for creating PNG, JPEG and GIF images and is commonly used to generate charts, graphics, thumbnails on the fly.<\/em><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt install php-gd<\/pre>\n\n\n\n<p>\u521b\u5efa\u4e00\u4e2a\u4e34\u65f6\u7684PHP INFO\u6d4b\u8bd5\u6587\u4ef6\uff0c\u6d4b\u8bd5\u901a\u7684\u4e4b\u540e\uff0c\u8bb0\u5f97\u5220\u9664<\/p>\n\n\n\n<p>\u4e00\u822c\u7684\u8def\u5f84\u4e3a \/var\/www\/html\/info.php<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?  phpinfo(); ?&gt;<\/pre>\n\n\n\n<p>\u5907\u6ce81, \u4e00\u822c\u63a8\u8350\u5b89\u88c5\u8fd9\u4e2aphp 7.4\u7684\u7248\u672c\uff0c\u4e0d\u63a8\u8350\u5b89\u88c5\u65e7\u7684\u7248\u672c\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9700\u6c42 \u4e3a\u4e86\u8854\u63a5Nginx\u548cMySQL\u6570\u636e\u5e93\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5php Nginx\u6ca1\u6709\u5185\u5728\u652f\u6301php\uff0c\u6545\u800c\uff0c\u6211\u4eec\u9700\u8981P [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/dasmz.com\/index.php?rest_route=\/wp\/v2\/posts\/1539"}],"collection":[{"href":"https:\/\/dasmz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dasmz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dasmz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dasmz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1539"}],"version-history":[{"count":13,"href":"https:\/\/dasmz.com\/index.php?rest_route=\/wp\/v2\/posts\/1539\/revisions"}],"predecessor-version":[{"id":1579,"href":"https:\/\/dasmz.com\/index.php?rest_route=\/wp\/v2\/posts\/1539\/revisions\/1579"}],"wp:attachment":[{"href":"https:\/\/dasmz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dasmz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dasmz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}