{"id":205,"date":"2018-11-22T00:59:27","date_gmt":"2018-11-21T16:59:27","guid":{"rendered":"https:\/\/wp.winter-weng.cc\/work\/?p=205"},"modified":"2022-09-29T23:04:10","modified_gmt":"2022-09-29T15:04:10","slug":"%e6%9b%b4%e6%96%b0-php-%e8%87%b3-7-2","status":"publish","type":"post","link":"https:\/\/wp.winter-weng.cc\/work\/?p=205","title":{"rendered":"\u66f4\u65b0 PHP \u81f3 7.2"},"content":{"rendered":"\n<p>\u9019\u53f0 Amazon EC2 \u662f 2014 \u67b6\u8d77\u4f86\u5f8c\u5c31\u6c92\u518d\u52d5\u4e86\uff0c\u5fc3\u8840\u4f86\u6f6e\u60f3\u8aaa\u66f4\u65b0\u4e00\u4e0b PHP \u5230 7.x\uff0c\u4e0d\u904e\u7ad9\u53f0\u4e0a\u4e3b\u8981\u4f7f\u7528 PHP \u7684\u670d\u52d9\u5176\u5be6\u4e5f\u53ea\u6709 WordPress \u800c\u5df2\u3002<\/p>\n\n\n\n<p>\u9019\u908a\u7c21\u55ae\u7d00\u9304\u4e00\u4e0b\u505a\u4e86\u54ea\u4e9b\u4e8b\uff5e\u56e0\u70ba\u6211\u5c0d\u65bc\u90e8\u7f72\u771f\u7684\u662f\u8d85\u5ee2\u7684\uff0c\u6240\u4ee5\u6709\u554f\u984c\u4e0d\u8981\u554f (?)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt-get upgrade<\/pre>\n\n\n\n<p>\u900f\u904e apt-get update \u6307\u4ee4\u9032\u884c\u8edf\u9ad4\u8cc7\u6599\u5eab\u540c\u6b65\uff0c\u6703\u6839\u64da \/etc\/apt\/sources.list \u4e2d\u8a2d\u5b9a\u5230 APT Server \u53bb\u66f4\u65b0\u8edf\u9ad4\u8cc7\u6599\u5eab\u3002<\/p>\n\n\n\n<p>\u8dd1\u5b8c\u4e4b\u5f8c\u900f\u904e <code>php -v<\/code> \u6aa2\u8996 PHP \u7248\u672c\uff0c\u5982\u679c\u6c92\u6709\u66f4\u65b0\u53ef\u4ee5\u624b\u52d5\u52a0\u5165PPA (Personal Package Archive)\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt-add-repository ppa:ondrej\/php\nsudo apt-get install php7.2<\/pre>\n\n\n\n<p>\u9019\u6642\u4e00\u4ef6\u9817\u5c37\u5c2c\u7684\u4e8b\u60c5\u767c\u751f\uff0c\u4e0b\u4e86 <code>php -v<\/code> \u986f\u793a 7.2\uff0c\u53ef\u662f WP \u548c phpinfo() \u90fd\u9084\u662f 5.x\uff0c\u60f3\u60f3\u53ef\u80fd\u662f apache \u7684\u76f8\u95dc\u8a2d\u5b9a\u6c92\u5c0d\u61c9\u8abf\u6574\u3002\u518d\u88dc\u88dd\u4e9b\u6771\u897f\u7136\u5f8c\u91cd\u555f\u670d\u52d9\u3002Nail it!<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt-get install php7.2-mysql libapache2-mod-php7.2 -y\nsudo service apache2 restart<\/pre>\n\n\n\n<p>\u5ef6\u4f38\u95b1\u8b80\uff1a<a href=\"https:\/\/askubuntu.com\/questions\/565784\/how-do-i-upgrade-php-version-to-the-latest-stable-released-version\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"\u5ef6\u4f38\u95b1\u8b80\uff1aHow do I upgrade PHP version to the latest stable released version? (\u5728\u65b0\u5206\u9801\u4e2d\u958b\u555f)\">How do I upgrade PHP version to the latest stable released version?<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u95dc\u65bc WP\uff0c\u6709\u4e00\u4e9b\u76f8\u95dc\u5957\u4ef6\u53ef\u4ee5\u4f7f\u7528\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a rel=\"noreferrer noopener\" aria-label=\"Display PHP Version (\u5728\u65b0\u5206\u9801\u4e2d\u958b\u555f)\" href=\"https:\/\/wordpress.org\/plugins\/display-php-version\/\" target=\"_blank\">Display PHP Version<\/a><\/li><li><a rel=\"noreferrer noopener\" aria-label=\"Display PHP Version\u2028PHP Compatibility Checker (\u5728\u65b0\u5206\u9801\u4e2d\u958b\u555f)\" href=\"https:\/\/wordpress.org\/plugins\/php-compatibility-checker\/\" target=\"_blank\">PHP Compatibility Checker<\/a>\uff1a\u53ef\u4ee5\u6383\u63cf\u662f\u5426\u6709\u5957\u4ef6\u6216\u6a23\u677f\u4e3b\u984c\u7121\u6cd5\u652f\u63f4\u65b0\u7248\u672c PHP\u3002<\/li><\/ul>\n\n\n\n<p>\u7576\u7136\uff0c\u66f4\u65b0\u524d\u4e0d\u5fd8\u5099\u4efd\u5594\uff5e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9019\u53f0 Amazon EC2 \u662f 2014 \u67b6\u8d77\u4f86\u5f8c&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[11],"tags":[],"class_list":["post-205","post","type-post","status-publish","format-standard","hentry","category-11"],"_links":{"self":[{"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=\/wp\/v2\/posts\/205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=205"}],"version-history":[{"count":1,"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=\/wp\/v2\/posts\/205\/revisions"}],"predecessor-version":[{"id":727,"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=\/wp\/v2\/posts\/205\/revisions\/727"}],"wp:attachment":[{"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.winter-weng.cc\/work\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}