{"id":45708,"date":"2024-10-07T01:19:13","date_gmt":"2024-10-06T17:19:13","guid":{"rendered":"https:\/\/server.hk\/cnblog\/45708\/"},"modified":"2024-11-14T10:36:04","modified_gmt":"2024-11-14T02:36:04","slug":"ubuntu-18-04-%e5%92%8c-debian-9-%e4%b8%8a%e5%ae%89%e8%a3%9d-php-5-6-%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/45708\/","title":{"rendered":"Ubuntu 18.04 \u548c Debian 9 \u4e0a\u5b89\u88dd PHP 5.6 \u65b9\u6cd5"},"content":{"rendered":"<h1 id=\"ubuntu-18-04-%e5%92%8c-debian-9-%e4%b8%8a%e5%ae%89%e8%a3%9d-php-5-6-%e6%96%b9%e6%b3%95-gehczfUGLG\">Ubuntu 18.04 \u548c Debian 9 \u4e0a\u5b89\u88dd PHP 5.6 \u65b9\u6cd5<\/h1>\n<p>\u5728\u7576\u524d\u7684\u7db2\u9801\u958b\u767c\u74b0\u5883\u4e2d\uff0cPHP \u662f\u4e00\u7a2e\u5ee3\u6cdb\u4f7f\u7528\u7684\u4f3a\u670d\u5668\u7aef\u8173\u672c\u8a9e\u8a00\u3002\u96d6\u7136 PHP \u7684\u6700\u65b0\u7248\u672c\u63d0\u4f9b\u4e86\u8a31\u591a\u65b0\u529f\u80fd\u548c\u6027\u80fd\u6539\u9032\uff0c\u4f46\u67d0\u4e9b\u820a\u7248\u61c9\u7528\u7a0b\u5f0f\u4ecd\u7136\u4f9d\u8cf4\u65bc PHP 5.6\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728 Ubuntu 18.04 \u548c Debian 9 \u4e0a\u5b89\u88dd PHP 5.6 \u7684\u6b65\u9a5f\u3002<\/p>\n<h2 id=\"%e5%89%8d%e6%9c%9f%e6%ba%96%e5%82%99-gehczfUGLG\">\u524d\u671f\u6e96\u5099<\/h2>\n<p>\u5728\u958b\u59cb\u5b89\u88dd\u4e4b\u524d\uff0c\u8acb\u78ba\u4fdd\u60a8\u7684\u7cfb\u7d71\u5df2\u7d93\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u66f4\u65b0\u7cfb\u7d71\uff1a<\/p>\n<pre><code>sudo apt update\nsudo apt upgrade<\/code><\/pre>\n<h2 id=\"%e5%9c%a8-ubuntu-18-04-%e4%b8%8a%e5%ae%89%e8%a3%9d-php-5-6-gehczfUGLG\">\u5728 Ubuntu 18.04 \u4e0a\u5b89\u88dd PHP 5.6<\/h2>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-1-%e6%b7%bb%e5%8a%a0-ppa-%e5%80%89%e5%ba%ab-gehczfUGLG\">\u6b65\u9a5f 1: \u6dfb\u52a0 PPA \u5009\u5eab<\/h3>\n<p>\u7531\u65bc PHP 5.6 \u5728 Ubuntu 18.04 \u7684\u5b98\u65b9\u5009\u5eab\u4e2d\u5df2\u7d93\u4e0d\u518d\u63d0\u4f9b\uff0c\u56e0\u6b64\u9700\u8981\u6dfb\u52a0\u4e00\u500b\u7b2c\u4e09\u65b9\u7684 PPA \u5009\u5eab\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u6dfb\u52a0 PPA\uff1a<\/p>\n<pre><code>sudo add-apt-repository ppa:ondrej\/php<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-2-%e6%9b%b4%e6%96%b0%e5%8c%85%e5%88%97%e8%a1%a8-gehczfUGLG\">\u6b65\u9a5f 2: \u66f4\u65b0\u5305\u5217\u8868<\/h3>\n<p>\u6dfb\u52a0 PPA \u5f8c\uff0c\u60a8\u9700\u8981\u66f4\u65b0\u5305\u5217\u8868\uff1a<\/p>\n<pre><code>sudo apt update<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-3-%e5%ae%89%e8%a3%9d-php-5-6-gehczfUGLG\">\u6b65\u9a5f 3: \u5b89\u88dd PHP 5.6<\/h3>\n<p>\u73fe\u5728\u53ef\u4ee5\u5b89\u88dd PHP 5.6 \u53ca\u5176\u5e38\u7528\u64f4\u5c55\uff1a<\/p>\n<pre><code>sudo apt install php5.6 php5.6-cli php5.6-fpm php5.6-mysql php5.6-xml php5.6-mbstring php5.6-curl<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-4-%e9%a9%97%e8%ad%89%e5%ae%89%e8%a3%9d-gehczfUGLG\">\u6b65\u9a5f 4: \u9a57\u8b49\u5b89\u88dd<\/h3>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u6aa2\u67e5 PHP \u7248\u672c\uff1a<\/p>\n<pre><code>php -v<\/code><\/pre>\n<p>\u5982\u679c\u986f\u793a PHP 5.6 \u7684\u7248\u672c\u4fe1\u606f\uff0c\u5247\u8868\u793a\u5b89\u88dd\u6210\u529f\u3002<\/p>\n<h2 id=\"%e5%9c%a8-debian-9-%e4%b8%8a%e5%ae%89%e8%a3%9d-php-5-6-gehczfUGLG\">\u5728 Debian 9 \u4e0a\u5b89\u88dd PHP 5.6<\/h2>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-1-%e6%b7%bb%e5%8a%a0-ppa-%e5%80%89%e5%ba%ab-gehczfUGLG\">\u6b65\u9a5f 1: \u6dfb\u52a0 PPA \u5009\u5eab<\/h3>\n<p>\u8207 Ubuntu \u4e00\u6a23\uff0cDebian 9 \u7684\u5b98\u65b9\u5009\u5eab\u4e5f\u4e0d\u518d\u63d0\u4f9b PHP 5.6\uff0c\u56e0\u6b64\u9700\u8981\u6dfb\u52a0 PPA \u5009\u5eab\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>sudo apt install apt-transport-https lsb-release ca-certificates\nwget -qO - https:\/\/packages.sury.org\/php\/apt.gpg | sudo apt-key add -\necho \"deb https:\/\/packages.sury.org\/php\/ $(lsb_release -sc) main\" | sudo tee \/etc\/apt\/sources.list.d\/php.list<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-2-%e6%9b%b4%e6%96%b0%e5%8c%85%e5%88%97%e8%a1%a8-gehczfUGLG\">\u6b65\u9a5f 2: \u66f4\u65b0\u5305\u5217\u8868<\/h3>\n<p>\u6dfb\u52a0 PPA \u5f8c\uff0c\u66f4\u65b0\u5305\u5217\u8868\uff1a<\/p>\n<pre><code>sudo apt update<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-3-%e5%ae%89%e8%a3%9d-php-5-6-gehczfUGLG\">\u6b65\u9a5f 3: \u5b89\u88dd PHP 5.6<\/h3>\n<p>\u73fe\u5728\u53ef\u4ee5\u5b89\u88dd PHP 5.6 \u53ca\u5176\u5e38\u7528\u64f4\u5c55\uff1a<\/p>\n<pre><code>sudo apt install php5.6 php5.6-cli php5.6-fpm php5.6-mysql php5.6-xml php5.6-mbstring php5.6-curl<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f-4-%e9%a9%97%e8%ad%89%e5%ae%89%e8%a3%9d-gehczfUGLG\">\u6b65\u9a5f 4: \u9a57\u8b49\u5b89\u88dd<\/h3>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u6aa2\u67e5 PHP \u7248\u672c\uff1a<\/p>\n<pre><code>php -v<\/code><\/pre>\n<p>\u5982\u679c\u986f\u793a PHP 5.6 \u7684\u7248\u672c\u4fe1\u606f\uff0c\u5247\u8868\u793a\u5b89\u88dd\u6210\u529f\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-gehczfUGLG\">\u7e3d\u7d50<\/h2>\n<p>\u5728 Ubuntu 18.04 \u548c Debian 9 \u4e0a\u5b89\u88dd PHP 5.6 \u7684\u904e\u7a0b\u76f8\u5c0d\u7c21\u55ae\uff0c\u53ea\u9700\u6dfb\u52a0\u76f8\u61c9\u7684 PPA \u5009\u5eab\uff0c\u7136\u5f8c\u5b89\u88dd\u6240\u9700\u7684 PHP \u7248\u672c\u53ca\u5176\u64f4\u5c55\u3002\u9019\u5c0d\u65bc\u9700\u8981\u904b\u884c\u820a\u7248\u61c9\u7528\u7a0b\u5f0f\u7684\u958b\u767c\u8005\u4f86\u8aaa\u975e\u5e38\u91cd\u8981\u3002\u82e5\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u7684\u4f3a\u670d\u5668\u89e3\u6c7a\u65b9\u6848\uff0c\u5efa\u8b70\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\uff0c\u4ee5\u4fbf\u66f4\u597d\u5730\u652f\u6301\u60a8\u7684\u958b\u767c\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3\u5982\u4f55\u5728 Ubuntu 18.04 \u548c Debian 9 \u4e0a\u5b89\u88dd PHP 5.6\uff0c\u6b65\u9a5f\u7c21\u55ae\u660e\u77ad\uff0c\u52a9\u60a8\u8f15\u9b06\u914d\u7f6e\u958b\u767c\u74b0\u5883\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-45708","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=45708"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45708\/revisions"}],"predecessor-version":[{"id":45709,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45708\/revisions\/45709"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=45708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=45708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=45708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}