{"id":117,"date":"2021-01-08T23:44:44","date_gmt":"2021-01-08T15:44:44","guid":{"rendered":"http:\/\/www.apiworld.tech\/wordpress\/?p=117"},"modified":"2021-01-08T23:44:44","modified_gmt":"2021-01-08T15:44:44","slug":"ubuntu20041-lts-an-zhuangphp801","status":"publish","type":"post","link":"http:\/\/madapapa.com\/wordpress\/?p=117","title":{"rendered":"Ubuntu20.04.1 LTS\u5b89\u88c5PHP8.0.1"},"content":{"rendered":"<p>\u8fd9\u662f\u76ee\u524d\u5168\u7f51\u6700\u65b0\u7684\u5b89\u88c5\u6307\u5357\u4e86\u3002<\/p>\n<p>\u9996\u5148\uff0c20.04.1\u7248\u672c\u7684Ubuntu\u6ca1\u6709\u5305\u62ec8.0.1PHP\uff0c\u6240\u4ee5\u9700\u8981\u5b89\u88c5\u7b2c\u4e09\u65b9\u7684PPA\u5e93\u6765\u8fdb\u884c\u5b89\u88c5\uff0c\u4e0b\u9762\u7684\u547d\u4ee4\u589e\u52a0\u7b2c\u4e09\u65b9PPT\u5230Ubuntu<\/p>\n<pre><code class=\"language-text\">sudo apt update\nsudo apt-get install software-properties-common\nsudo add-apt-repository ppa:ondrej\/php\nsudo add-apt-repository ppa:ondrej\/nginx\n<\/code><\/pre>\n<p>\u4e0eApache\u4e0d\u540c\uff0cNginx\u6ca1\u6709\u5bf9php\u6587\u4ef6\u7684\u5185\u5efa\u652f\u6301\uff0c\u56e0\u6b64\u4f7f\u7528php-fpm\uff08fastCGI process manager\uff09\u6765\u5904\u7406PHP\u6587\u4ef6\u3002<\/p>\n<p>\u76ee\u524d\u6700\u65b0\u7684php\u7248\u672c\u662f8.0.1\uff0c\u4f46\u662faliyun\u6ca1\u6cd5\u81ea\u52a8\u5b89\u88c5\u8fd9\u4e2a\u6e90\uff0c\u624b\u52a8\u5b89\u88c5\u592a\u9ebb\u70e6\uff0c\u56e0\u6b64\u6211\u53ea\u6709\u5148\u75288.0\u6765\u8bd5\u8bd5\u3002<\/p>\n<p>\u548cApache2\u4e0d\u540c\uff0cNginx\u81ea\u5df1\u6ca1\u6709\u81ea\u5efa\u961fphp\u7684\u5904\u7406\u652f\u6301\uff0c\u6240\u4ee5\u9700\u8981\u5206\u522b\u5b89\u88c5Nginx\u548cPHP<\/p>\n<pre><code class=\"language-text\">#sudo apt update\n#sudo apt install nginx php8.0-fpm\n<\/code><\/pre>\n<p>\u91cd\u65b0\u542f\u52a8Nginx\u548cPHP-FRM<\/p>\n<pre><code class=\"language-text\">sudo systemctl restart nginx\nsudo systemctl restart php8.0-fpm\n<\/code><\/pre>\n<p>\u68c0\u67e5\u670d\u52a1\u72b6\u6001\u5982\u4e0b<\/p>\n<pre><code class=\"language-text\">systemctl status php8.0-fpm.service\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/www.apiworld.tech\/wordpress\/wp-content\/uploads\/2021\/01\/16101621195306.jpg\" alt=\"\" style=\"width:1171px;\"\/><\/p>\n<p>\u73b0\u5728\u4f60\u53ef\u4ee5\u7f16\u8f91\u670d\u52a1\u5668\u914d\u7f6e\uff0c\u65b9\u4fbfNginx\u5904\u7406PHP\u6587\u4ef6\u3002<\/p>\n<p>\u7531\u4e8eNginx\u6ca1\u6709\u5185\u5efaPHP\u652f\u6301\uff0c\u6240\u4ee5\u9700\u6c42\u624b\u5de5\u7f16\u8f91server\u90e8\u5206\u6765\u652f\u6491PHP\uff0c\u5982\u4e0b<\/p>\n<pre><code class=\"language-text\">sudo nano \/etc\/nginx\/sites-available\/default\n<\/code><\/pre>\n<p>\u7f16\u8f91\u4e0b\u6587\u7c97\u4f53\u90e8\u5206<\/p>\n<pre><code class=\"language-text\">   # Add index.php to the list if you are using PHP\n        index index.php index.html index.htm index.nginx-debian.html;\n        # pass PHP scripts to FastCGI server\n        #\n        location ~ \\.php$ {\n                include snippets\/fastcgi-php.conf;\n        #\n        #       # With php-fpm (or other unix sockets):\n                fastcgi_pass unix:\/var\/run\/php\/php8.0-fpm.sock;\n        #       # With php-cgi (or other tcp sockets):\n        #       fastcgi_pass 127.0.0.1:9000;\n        }\n        # deny access to .htaccess files, if Apache&#39;s document root\n        # concurs with nginx&#39;s one\n<\/code><\/pre>\n<p>\u7136\u540ereload\u4e24\u4e2a\u670d\u52a1<\/p>\n<pre><code class=\"language-text\">sudo systemctl reload nginx\nsudo systemctl reload php8.0-fpm\n<\/code><\/pre>\n<p>\u53c2\u8003\u6587\u6863\u5982\u4e0b<br \/>\n<a href=\"https:\/\/websiteforstudents.com\/install-php-8-0-on-ubuntu-20-04-18-04\/\">https:\/\/websiteforstudents.com\/install-php-8-0-on-ubuntu-20-04-18-04\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u662f\u76ee\u524d\u5168\u7f51\u6700\u65b0\u7684\u5b89\u88c5\u6307\u5357\u4e86\u3002 \u9996\u5148\uff0c20.04.1\u7248\u672c\u7684Ubuntu\u6ca1\u6709\u5305\u62ec8.0.1PHP\uff0c\u6240\u4ee5\u9700\u8981\u5b89\u88c5\u7b2c\u4e09\u65b9\u7684PPA\u5e93\u6765\u8fdb\u884c\u5b89\u88c5\uff0c\u4e0b\u9762\u7684\u547d\u4ee4\u589e\u52a0\u7b2c\u4e09\u65b9PPT\u5230Ubuntu sudo apt update sudo apt-get install software-properties-common sudo add-apt-repository ppa:ondrej\/php sudo add-apt-repository ppa:ondrej\/nginx \u4e0eApache\u4e0d\u540c\uff0cNginx\u6ca1\u6709\u5bf9php\u6587\u4ef6\u7684\u5185\u5efa\u652f\u6301\uff0c\u56e0\u6b64\u4f7f\u7528php-fpm\uff08fastCGI process manager\uff09\u6765\u5904\u7406PHP\u6587\u4ef6\u3002 \u76ee\u524d\u6700\u65b0\u7684php\u7248\u672c\u662f8.0.1\uff0c\u4f46\u662faliyun\u6ca1\u6cd5\u81ea\u52a8\u5b89\u88c5\u8fd9\u4e2a\u6e90\uff0c\u624b\u52a8\u5b89\u88c5\u592a\u9ebb\u70e6\uff0c\u56e0\u6b64\u6211\u53ea\u6709\u5148\u75288.0\u6765\u8bd5\u8bd5\u3002 \u548cApache2\u4e0d\u540c\uff0cNginx\u81ea\u5df1\u6ca1\u6709\u81ea\u5efa\u961fphp\u7684\u5904\u7406\u652f\u6301\uff0c\u6240\u4ee5\u9700\u8981\u5206\u522b\u5b89\u88c5Nginx\u548cPHP #sudo apt update #sudo apt install nginx php8.0-fpm \u91cd\u65b0\u542f\u52a8Nginx\u548cPHP-FRM sudo systemctl restart nginx sudo systemctl restart php8.0-fpm \u68c0\u67e5\u670d\u52a1\u72b6\u6001\u5982\u4e0b systemctl status php8.0-fpm.service \u73b0\u5728\u4f60\u53ef\u4ee5\u7f16\u8f91\u670d\u52a1\u5668\u914d\u7f6e\uff0c\u65b9\u4fbfNginx\u5904\u7406PHP\u6587\u4ef6\u3002 \u7531\u4e8eNginx\u6ca1\u6709\u5185\u5efaPHP\u652f\u6301\uff0c\u6240\u4ee5\u9700\u6c42\u624b\u5de5\u7f16\u8f91server\u90e8\u5206\u6765\u652f\u6491PHP\uff0c\u5982\u4e0b sudo nano \/etc\/nginx\/sites-available\/default \u7f16\u8f91\u4e0b\u6587\u7c97\u4f53\u90e8\u5206 # Add index.php to the list if you &hellip; <a href=\"http:\/\/madapapa.com\/wordpress\/?p=117\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Ubuntu20.04.1 LTS\u5b89\u88c5PHP8.0.1<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[5],"tags":[18],"class_list":["post-117","post","type-post","status-publish","format-standard","hentry","category-linux","tag-php"],"_links":{"self":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=117"}],"version-history":[{"count":0,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/117\/revisions"}],"wp:attachment":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=117"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}