{"id":5176,"date":"2022-07-08T12:01:09","date_gmt":"2022-07-08T04:01:09","guid":{"rendered":"http:\/\/www.menglanglang.cn\/?p=5176"},"modified":"2022-09-16T05:52:20","modified_gmt":"2022-09-15T21:52:20","slug":"php-%e7%89%88%e6%9c%ac%e4%bb%8e-5-x-%e5%8d%87%e7%ba%a7%e5%88%b0-7-x","status":"publish","type":"post","link":"http:\/\/www.menglanglang.cn\/?p=5176","title":{"rendered":"Linux \u670d\u52a1\u5668\u4e2d PHP \u7248\u672c\u4ece 5.x \u5347\u7ea7\u5230 7.x"},"content":{"rendered":"\n<p>\u200b\u5982\u679c\u628a Linux \u670d\u52a1\u5668\u7684 PHP \u7248\u672c\u5347\u7ea7\u5462\uff1f\u6bd4\u5982\u76ee\u524d\u7248\u672c\u662f&nbsp;PHP 5.6.40\uff0c\u5347\u7ea7\u52307.4 \u5f53\u524d\u6700\u6700\u65b0\u7248\u672c&nbsp;PHP 7.4.30\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u67e5\u770b\u5f53\u524d PHP \u7248\u672c<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>&nbsp;php -v<\/p><\/blockquote>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" height=\"92\" width=\"878\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/df8d154f74ac4595a46eecb7e54639a5.png\" alt=\"\"\/><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5378\u8f7d\u5df2\u5b89\u88c5\u7684 PHP<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>yum remove php-common<\/p><\/blockquote>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" height=\"659\" width=\"900\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/aa221517cc1546e1b0b29554fe227663.png\" alt=\"\"\/><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u88c5 EPEL \u6e90<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>yum install epel-release<\/p><\/blockquote>\n\n\n\n<p>\u5982\u679c\u5df2\u5b89\u88c5\u8fc7\uff0c\u5219\u63d0\u793a\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" height=\"93\" width=\"773\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/64087d1cc1cc4a8fbf6230e58b2d8ef5.png\" alt=\"\"\/><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u88c5 remi&nbsp;\u6e90<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>yum install http:\/\/rpms.remirepo.net\/enterprise\/remi-release-7.rpm<\/p><\/blockquote>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" height=\"331\" width=\"627\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/7289fca75deb46188f800d19cd3a2b5a.png\" alt=\"\"\/><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u88c5 yum-config-manager<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>yum install yum-utils<\/p><\/blockquote>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" height=\"364\" width=\"900\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/04f4c35e576946f3bcc098d7bd2f670e.png\" alt=\"\"\/><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u6307\u5b9a remi \u7684php 7.4 \u4ed3\u5e93<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>yum-config-manager --enable remi-php74<\/p><\/blockquote>\n\n\n\n<p><strong>\u6ce8\u610f\uff1a\u5982\u679c\u8981\u5b89\u88c5\u5176\u5b83 PHP \u7248\u672c\uff0c\u53ef\u4ee5\u628a\u4e0a\u9762\u547d\u4ee4\u4e2d\u7684 remi-php74 \u6539\u4e3a remi-php72\u3001remi-php71\u3001remi-php70 \u7b49\u3002<\/strong><\/p>\n\n\n\n<p>\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;root@langlang ~]# yum-config-manager --enable remi-php74\nLoaded plugins: fastestmirror\n============================================================ repo: remi-php74 ============================================================\n&#91;remi-php74]\nasync = True\nbandwidth = 0\nbase_persistdir = \/var\/lib\/yum\/repos\/x86_64\/7\nbaseurl = \ncache = 0\ncachedir = \/var\/cache\/yum\/x86_64\/7\/remi-php74\ncheck_config_file_age = True\ncompare_providers_priority = 80\ncost = 1000\ndeltarpm_metadata_percentage = 100\ndeltarpm_percentage = \nenabled = 1\nenablegroups = True\nexclude = \nfailovermethod = priority\nftp_disable_epsv = False\ngpgcadir = \/var\/lib\/yum\/repos\/x86_64\/7\/remi-php74\/gpgcadir\ngpgcakey = \ngpgcheck = True\ngpgdir = \/var\/lib\/yum\/repos\/x86_64\/7\/remi-php74\/gpgdir\ngpgkey = file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-remi\nhdrdir = \/var\/cache\/yum\/x86_64\/7\/remi-php74\/headers\nhttp_caching = all\nincludepkgs = \nip_resolve = \nkeepalive = True\nkeepcache = False\nmddownloadpolicy = sqlite\nmdpolicy = group:small\nmediaid = \nmetadata_expire = 21600\nmetadata_expire_filter = read-only:present\nmetalink = \nminrate = 0\nmirrorlist = http:\/\/cdn.remirepo.net\/enterprise\/7\/php74\/mirror\nmirrorlist_expire = 86400\nname = Remi's PHP 7.4 RPM repository for Enterprise Linux 7 - x86_64\nold_base_cache_dir = \npassword = \npersistdir = \/var\/lib\/yum\/repos\/x86_64\/7\/remi-php74\npkgdir = \/var\/cache\/yum\/x86_64\/7\/remi-php74\/packages\nproxy = False\nproxy_dict = \nproxy_password = \nproxy_username = \nrepo_gpgcheck = False\nretries = 10\nskip_if_unavailable = False\nssl_check_cert_permissions = True\nsslcacert = \nsslclientcert = \nsslclientkey = \nsslverify = True\nthrottle = 0\ntimeout = 30.0\nui_id = remi-php74\nui_repoid_vars = releasever,\n   basearch\nusername = \n\n&#91;root@langlang ~]# <\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u88c5\u5347\u7ea7 php<\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>yum -y install php php-mysql gd php-gd gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc php-imap<\/p><\/blockquote>\n\n\n\n<p>\u9a8c\u8bc1\u5347\u7ea7\u540e\u7684 PHP \u7248\u672c\uff0c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" height=\"79\" width=\"618\" src=\"\/\/images.weserv.nl\/?url=https:\/\/img-blog.csdnimg.cn\/dfcf005644d34718bc8f089ae9abe49f.png\" alt=\"\"\/><\/p>\n\n\n\n<p>Good Luck\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u200b\u5982\u679c\u628a Linux \u670d\u52a1\u5668\u7684 PHP \u7248\u672c\u5347\u7ea7\u5462\uff1f\u6bd4\u5982\u76ee\u524d\u7248\u672c\u662f&nbsp;PHP 5.6.40\uff0c\u5347\u7ea7\u52307. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[602,598,436,878,214],"class_list":["post-5176","post","type-post","status-publish","format-standard","hentry","category-php","tag-linux","tag-php","tag-436","tag-878","tag-214"],"_links":{"self":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/5176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5176"}],"version-history":[{"count":1,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/5176\/revisions"}],"predecessor-version":[{"id":5202,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/5176\/revisions\/5202"}],"wp:attachment":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5176"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}