{"id":52825,"date":"2024-10-09T06:00:13","date_gmt":"2024-10-08T22:00:13","guid":{"rendered":"https:\/\/server.hk\/cnblog\/52825\/"},"modified":"2024-11-14T10:37:16","modified_gmt":"2024-11-14T02:37:16","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8-ubuntu-18-04-%e5%92%8c-debian-9-%e4%b8%8a%e5%ae%89%e8%a3%9d-php-5-6","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/52825\/","title":{"rendered":"\u5982\u4f55\u5728 Ubuntu 18.04 \u548c Debian 9 \u4e0a\u5b89\u88dd PHP 5.6"},"content":{"rendered":"<h1 id=\"%e5%a6%82%e4%bd%95%e5%9c%a8-ubuntu-18-04-%e5%92%8c-debian-9-%e4%b8%8a%e5%ae%89%e8%a3%9d-php-5-6-cFqGGKDrLV\">\u5982\u4f55\u5728 Ubuntu 18.04 \u548c Debian 9 \u4e0a\u5b89\u88dd PHP 5.6<\/h1>\n<p>PHP \u662f\u4e00\u7a2e\u5ee3\u6cdb\u4f7f\u7528\u7684\u958b\u6e90\u8173\u672c\u8a9e\u8a00\uff0c\u7279\u5225\u9069\u5408\u65bc\u7db2\u9801\u958b\u767c\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\u5e8f\u4ecd\u7136\u4f9d\u8cf4\u65bc PHP 5.6\u3002\u672c\u6587\u5c07\u6307\u5c0e\u60a8\u5982\u4f55\u5728 Ubuntu 18.04 \u548c Debian 9 \u4e0a\u5b89\u88dd PHP 5.6\u3002<\/p>\n<h2 id=\"%e5%89%8d%e6%9c%9f%e6%ba%96%e5%82%99-cFqGGKDrLV\">\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%ae%89%e8%a3%9d-php-5-6-%e7%9a%84%e6%ad%a5%e9%a9%9f-cFqGGKDrLV\">\u5b89\u88dd PHP 5.6 \u7684\u6b65\u9a5f<\/h2>\n<h3 id=\"1-%e6%b7%bb%e5%8a%a0-php-ppa-cFqGGKDrLV\">1. \u6dfb\u52a0 PHP PPA<\/h3>\n<p>\u5728 Ubuntu \u548c Debian \u4e0a\uff0c\u60a8\u9700\u8981\u6dfb\u52a0\u4e00\u500b PPA\uff08\u500b\u4eba\u5305\u5b58\u6a94\uff09\u4f86\u7372\u53d6 PHP 5.6\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<p>\u7136\u5f8c\uff0c\u66f4\u65b0\u60a8\u7684\u5305\u5217\u8868\uff1a<\/p>\n<pre><code>sudo apt update<\/code><\/pre>\n<h3 id=\"2-%e5%ae%89%e8%a3%9d-php-5-6-cFqGGKDrLV\">2. \u5b89\u88dd PHP 5.6<\/h3>\n<p>\u73fe\u5728\uff0c\u60a8\u53ef\u4ee5\u5b89\u88dd PHP 5.6 \u53ca\u5176\u5e38\u7528\u64f4\u5c55\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\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<p>\u9019\u5c07\u5b89\u88dd PHP 5.6 \u53ca\u5176\u4e00\u4e9b\u5e38\u7528\u7684\u64f4\u5c55\u3002\u60a8\u53ef\u4ee5\u6839\u64da\u9700\u8981\u6dfb\u52a0\u5176\u4ed6\u64f4\u5c55\u3002<\/p>\n<h3 id=\"3-%e9%a9%97%e8%ad%89%e5%ae%89%e8%a3%9d-cFqGGKDrLV\">3. \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\u5b89\u88dd\u6210\u529f\uff0c\u60a8\u61c9\u8a72\u6703\u770b\u5230\u985e\u4f3c\u4ee5\u4e0b\u7684\u8f38\u51fa\uff1a<\/p>\n<pre><code>PHP 5.6.x (cli) (built: ...) ( NTS )<\/code><\/pre>\n<h2 id=\"%e9%85%8d%e7%bd%ae-php-5-6-cFqGGKDrLV\">\u914d\u7f6e PHP 5.6<\/h2>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u6839\u64da\u60a8\u7684\u9700\u6c42\u4f86\u914d\u7f6e PHP\u3002PHP \u7684\u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u4f4d\u65bc \/etc\/php\/5.6\/fpm\/php.ini\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u6587\u672c\u7de8\u8f2f\u5668\u4f86\u7de8\u8f2f\u6b64\u6587\u4ef6\uff1a<\/p>\n<pre><code>sudo nano \/etc\/php\/5.6\/fpm\/php.ini<\/code><\/pre>\n<p>\u5728\u9019\u88e1\uff0c\u60a8\u53ef\u4ee5\u8abf\u6574\u5982\u4e0a\u50b3\u6587\u4ef6\u5927\u5c0f\u3001\u5167\u5b58\u9650\u5236\u7b49\u8a2d\u7f6e\u3002\u5b8c\u6210\u5f8c\uff0c\u4fdd\u5b58\u4e26\u9000\u51fa\u7de8\u8f2f\u5668\u3002<\/p>\n<h2 id=\"%e9%87%8d%e5%95%9f-php-fpm-%e6%9c%8d%e5%8b%99-cFqGGKDrLV\">\u91cd\u555f PHP-FPM \u670d\u52d9<\/h2>\n<p>\u6bcf\u7576\u60a8\u66f4\u6539 PHP \u914d\u7f6e\u6642\uff0c\u90fd\u9700\u8981\u91cd\u555f PHP-FPM \u670d\u52d9\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u91cd\u555f\u670d\u52d9\uff1a<\/p>\n<pre><code>sudo systemctl restart php5.6-fpm<\/code><\/pre>\n<h2 id=\"%e7%b5%90%e8%ab%96-cFqGGKDrLV\">\u7d50\u8ad6<\/h2>\n<p>\u5728 Ubuntu 18.04 \u548c Debian 9 \u4e0a\u5b89\u88dd PHP 5.6 \u662f\u4e00\u500b\u76f8\u5c0d\u7c21\u55ae\u7684\u904e\u7a0b\u3002\u901a\u904e\u6dfb\u52a0 PPA\u3001\u5b89\u88dd PHP \u53ca\u5176\u64f4\u5c55\uff0c\u4e26\u9032\u884c\u5fc5\u8981\u7684\u914d\u7f6e\uff0c\u60a8\u5c31\u53ef\u4ee5\u5728\u60a8\u7684\u4f3a\u670d\u5668\u4e0a\u904b\u884c\u820a\u7248\u61c9\u7528\u7a0b\u5e8f\u3002<\/p>\n<p>\u5982\u679c\u60a8\u9700\u8981\u7a69\u5b9a\u7684\u4f3a\u670d\u5668\u74b0\u5883\u4f86\u904b\u884c\u60a8\u7684\u61c9\u7528\u7a0b\u5e8f\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\uff0c\u9019\u5c07\u70ba\u60a8\u63d0\u4f9b\u9748\u6d3b\u6027\u548c\u53ef\u64f4\u5c55\u6027\uff0c\u6eff\u8db3\u60a8\u7684\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b78\u7fd2\u5982\u4f55\u5728 Ubuntu 18.04 \u548c Debian 9 \u4e0a\u5b89\u88dd PHP 5.6\uff0c\u7c21\u55ae\u6b65\u9a5f\u52a9\u4f60\u5feb\u901f\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-52825","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/52825","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=52825"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/52825\/revisions"}],"predecessor-version":[{"id":52826,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/52825\/revisions\/52826"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=52825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=52825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=52825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}