{"id":10084,"date":"2024-02-19T19:43:51","date_gmt":"2024-02-19T11:43:51","guid":{"rendered":"https:\/\/www.chenqing.work\/?p=10084"},"modified":"2024-02-20T11:13:49","modified_gmt":"2024-02-20T03:13:49","slug":"%e6%9a%b4%e5%8a%9b%e5%8d%87%e7%ba%a7%e5%8d%9a%e5%ae%a2%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.chenqing.work\/?p=10084","title":{"rendered":"\u66b4\u529b\u5347\u7ea7\u535a\u5ba2\u670d\u52a1\u5668"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1280\" src=\"https:\/\/www.chenqing.work\/wp-content\/uploads\/2024\/02\/photo-1633591324611-55ee4caa790f.jpg\" alt=\"\" class=\"wp-image-10092\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u6700\u8fd1 WordPress \u9762\u677f\u63d0\u793a PHP \u7248\u672c\u8fc7\u4f4e\uff0c\u4e00\u76f4\u653e\u7740\u6ca1\u7406\uff0c\u6625\u8282\u56de\u6765\u53d1\u73b0\u6709\u4e9b\u63d2\u4ef6\u66f4\u65b0\u4e5f\u4e0d\u652f\u6301\u4e86\uff0c\u6b63\u597d\u6709\u70b9\u7a7a\u95f2\u5c31\u5347\u7ea7\u4e00\u4e0b\uff0c\u4f5c\u4e3a\u5f00\u5e74\u7684\u7b2c\u4e00\u4e2a\u6298\u817e\u4e8b\u9879\u3002<\/p>\n\n\n\n<p>\u539f\u8ba1\u5212\u76f4\u63a5 apt install php7.4\uff0c\u4f46\u670d\u52a1\u5668\u7248\u672c\u8fc7\u4f4e\uff0crepository \u91cc\u641c\u4e0d\u5230 php7.4\uff0c\u5c31\u628a Ubuntu \u7248\u672c\u4e5f\u5347\u4e00\u5347\uff0c\u4ece Ubuntu 18.04 \u5347\u5230 Ubuntu 20.04\u3002<\/p>\n\n\n\n<p>\u5347\u7ea7\u4e0d\u80fd\u641e\u574f\u4e86\u535a\u5ba2\uff0c\u7f51\u4e0a\u7684\u5206\u4eab\u4e5f\u662f\u4e94\u82b1\u516b\u95e8\uff0c\u6700\u540e\u51b3\u5b9a\u83bd\u4e00\u56de\uff0c\u6765\u4e2a\u66b4\u529b\u5347\u7ea7\uff0c\u9047\u5230\u95ee\u9898\u4fee\u7406\u95ee\u9898\uff0c\u5175\u6765\u5c06\u6321\u6c34\u6765\u571f\u63a9 \u2014\u2014 \u60f3\u60f3\u8fd8\u6709\u70b9\u523a\u6fc0\u3002<\/p>\n\n\n\n<p>\u5148\u539f\u5730\u66f4\u65b0\u4e00\u4e0b\u7cfb\u7edf\u7684\u6240\u6709\u8f6f\u4ef6\u5305\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# 1\nsudo apt update &amp;&amp; sudo apt upgrade\nsudo apt --purge autoremove\n<\/pre><\/div>\n\n\n<p>\u6253\u5f00 \/etc\/update-manager\/release-upgrades\uff0c<strong>\u786e\u8ba4\u914d\u7f6e\u9879 Prompt=lts \u662f\u542f\u7528\u72b6\u6001<\/strong>\uff08\u5728\u5347\u7ea7\u65f6\u68c0\u67e5\u79bb\u5f53\u524d\u7248\u672c\u6700\u8fd1\u7684\u53ef\u7528 LTS \u7248\u672c\uff09\u3002<\/p>\n\n\n\n<p>\u5f00\u59cb\u5347\u7ea7\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# 2\nsudo do-release-upgrade\n<\/pre><\/div>\n\n\n<p>\u5728\u5347\u7ea7\u8fc7\u7a0b\u4e2d\uff0clxd \u9009\u7684 4.0\uff0c\/etc\/sysct.conf \u76f8\u5173\u7684\u9879\u9009\u7684 I\uff08\u5347\u7ea7\u5230\u6700\u65b0\u7684\u4e3b\u6d41\u7248\u672c\uff09\uff0cnginx \u5347\u7ea7\u9009\u7684 O\uff08\u4fdd\u6301\u5f53\u524d\u7248\u672c\u4e0d\u53d8\uff09\uff0c\u6700\u540e\u540c\u610f\u6e05\u7406\u6ca1\u7528\u7684 packages \u5e76\u91cd\u542f\u3002<\/p>\n\n\n\n<p>\u91cd\u542f\u540e\u8bbf\u95ee\u535a\u5ba2\uff0c\u62a5 502 \u9519\u8bef\uff0c\u770b Nginx \u7684 error.log \u63d0\u793a\u627e\u4e0d\u5230 php7.2-fpm.sock \u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"970\" height=\"81\" src=\"https:\/\/www.chenqing.work\/wp-content\/uploads\/2024\/02\/image.png\" alt=\"\" class=\"wp-image-10099\"\/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u7531\u4e8e\u73b0\u5728 PHP \u5df2\u7ecf\u5347\u7ea7\u5230 7.4\uff0c\u627e\u4e0d\u5230 php7.2-fpm.sock \u5b9e\u5c5e\u6b63\u5e38\uff0c\u968f\u7740 PHP \u7248\u672c\u5347\u7ea7\uff0c\/var\/run\/php\/ \u8def\u5f84\u4e0b\u5df2\u7ecf\u53d8\u4e3a php7.4-fpm.sock\uff08.sock \u6587\u4ef6\u5c31\u662f IPC \u91cc\u7684 Unix Socket\uff0c\u4f9b\u540c\u4e00\u53f0\u673a\u5668\u4e0a\u7684\u4e24\u4e2a\u8fdb\u7a0b\u901a\u4fe1\uff0c\u4f18\u70b9\u662f\u4e0d\u9700\u8981\u7ecf\u8fc7\u7f51\u7edc\u534f\u8bae\u6808\u5904\u7406\uff09\u3002<\/p>\n\n\n\n<p>\u8fdb \/etc\/nginx\/sites-enabled\/\uff0c\u4fee\u6539 default \u6587\u4ef6\uff0c\u8c03\u6574\u914d\u7f6e\u4e3a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# 3\nfastcgi_pass unix:\/var\/run\/php\/php7.4-fpm.sock;\n<\/pre><\/div>\n\n\n<p>\u6539\u5b8c\u540e\u91cd\u65b0\u8f7d\u5165\u914d\u7f6e\uff0c\u518d\u6b21\u8bbf\u95ee\u535a\u5ba2\uff0c\u6b63\u5e38\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# 4 \nnginx -s reload\n<\/pre><\/div>\n\n\n<p>\u6574\u4e2a\u5347\u7ea7\u8fc7\u7a0b\u6bd4\u8f83\u987a\u7545\uff0c\u6ca1\u9047\u5230\u4ec0\u4e48\u50cf\u6837\u7684\u56f0\u96be \u2014\u2014 \u6469\u62f3\u64e6\u638c\u51c6\u5907 debug WordPress \uff0c\u8c01\u6599\u5347\u7ea7\u592a\u4e1d\u6ed1\u4e86\u6709\u70b9\u4e0d\u8fc7\u763e\u3002<\/p>\n\n\n\n<p>\u5347\u7ea7\u5230 20.04 \u540e\u5728 Vultr \u9762\u677f\u4e0a\u770b\u5230\u7684 OS \u7248\u672c\u8fd8\u662f 18.04\uff0c\u770b\u6765\u8fd9\u4e2a\u503c\u4e0d\u4f1a\u6839\u636e\u7cfb\u7edf\u7684\u5b9e\u9645\u60c5\u51b5\u66f4\u65b0\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Ref\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>https:\/\/docs.vultr.com\/how-to-upgrade-ubuntu-18-04-lts-to-20-04-lts<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1 WordPress \u9762\u677f\u63d0\u793a PHP \u7248\u672c\u8fc7\u4f4e\uff0c\u4e00\u76f4\u653e\u7740\u6ca1\u7406\uff0c\u6625\u8282\u56de\u6765\u53d1\u73b0\u6709\u4e9b\u63d2\u4ef6\u66f4\u65b0\u4e5f\u4e0d\u652f\u6301 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[159,171],"class_list":["post-10084","post","type-post","status-publish","format-standard","hentry","category-code","tag-ubuntu","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.chenqing.work\/index.php?rest_route=\/wp\/v2\/posts\/10084","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chenqing.work\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chenqing.work\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chenqing.work\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chenqing.work\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10084"}],"version-history":[{"count":46,"href":"https:\/\/www.chenqing.work\/index.php?rest_route=\/wp\/v2\/posts\/10084\/revisions"}],"predecessor-version":[{"id":10145,"href":"https:\/\/www.chenqing.work\/index.php?rest_route=\/wp\/v2\/posts\/10084\/revisions\/10145"}],"wp:attachment":[{"href":"https:\/\/www.chenqing.work\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10084"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chenqing.work\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10084"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chenqing.work\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10084"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}