{"id":731,"date":"2020-05-08T09:15:47","date_gmt":"2020-05-08T01:15:47","guid":{"rendered":"http:\/\/www.shenmdyw.com\/?p=731"},"modified":"2020-05-08T09:16:50","modified_gmt":"2020-05-08T01:16:50","slug":"centos-7-%e7%b3%bb%e7%bb%9f%e6%ba%90%e4%bb%a3%e7%a0%81%e5%ae%89%e8%a3%85-php-7-4-x","status":"publish","type":"post","link":"http:\/\/www.shenmdyw.com\/index.php\/2020\/05\/08\/centos-7-%e7%b3%bb%e7%bb%9f%e6%ba%90%e4%bb%a3%e7%a0%81%e5%ae%89%e8%a3%85-php-7-4-x\/","title":{"rendered":"CentOS 7 \u7cfb\u7edf\u6e90\u4ee3\u7801\u5b89\u88c5 PHP 7.4.x"},"content":{"rendered":"<p>PHP 7.4 \u6b63\u5f0f\u7248\u5df2\u7ecf\u53d1\u5e03\uff0c\u662f\u65f6\u5019\u5b89\u88c5\u5c1d\u9c9c\u4e86\u3002<\/p>\n<p>\u9996\u5148\u4e0b\u8f7d\u6e90\u4ee3\u7801\u5305\u5e76\u89e3\u538b\uff1a<\/p>\n<p># wget https:\/\/www.php.net\/distributions\/php-7.4.1.tar.gz<br \/>\n# tar -zxvf php-7.4.1.tar.gz<br \/>\n\u7136\u540e\u8fdb\u5165\u6e90\u4ee3\u7801\u6587\u4ef6\u5939\uff0c\u7f16\u8bd1\u5b89\u88c5\uff1a<\/p>\n<p># cd .\/php-7.4.1<br \/>\n# .\/configure &#8211;enable-fpm &#8211;enable-gd &#8211;with-jpeg &#8211;with-zlib &#8211;with-pdo-mysql &#8211;with-mysql-sock=\/var\/mysql\/mysql.sock<br \/>\n# make &#038;&#038; make install<br \/>\n\u672c\u6b21\u7f16\u8bd1\u7684 PHP 7.4.x \u53ea\u4e3a\u5176\u6dfb\u52a0\u4e86\u4e3b\u8981\u7684\u529f\u80fd\uff0c\u5305\u62ec\u5904\u7406\u56fe\u7247\u548c\u4f7f\u7528 pdo \u8fde\u63a5 MySQL \u6570\u636e\u5e93\u4ee5\u53ca fpm \u529f\u80fd\uff0c\u5176\u4f59\u529f\u80fd\u53ef\u4ee5\u901a\u8fc7\u5b89\u88c5\u6269\u5c55\u65b9\u5f0f\u6dfb\u52a0\u3002<br \/>\n<!--more--><\/p>\n<p>\u6dfb\u52a0\u6269\u5c55\u9700\u8981\u8fdb\u5165\u6e90\u4ee3\u7801\u201dext\u201d\u76ee\u5f55\u4e0b\u5bf9\u5e94\u6269\u5c55\u540d\u7684\u76ee\u5f55\uff0c\u4f7f\u7528 curl \u6269\u5c55\uff0c\u5219\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u7f16\u8bd1\u5b89\u88c5\uff1a<\/p>\n<p># cd .\/php-7.4.1\/ext\/curl<br \/>\n# .\/configure<br \/>\n# make &#038;&#038; make install<br \/>\n\u6269\u5c55\u5b89\u88c5\u6210\u529f\u540e\uff0c\u5e76\u4e0d\u4ee3\u8868 PHP \u5df2\u7ecf\u652f\u6301\u4e86\u8be5\u6269\u5c55\uff0c\u9700\u8981\u5728\u201dphp.ini\u201d\u4e2d\u6dfb\u52a0\u914d\u7f6e\u542f\u7528\u6269\u5c55\u3002<\/p>\n<p>\u7f16\u8bd1\u5b89\u88c5\u8fc7\u7a0b\u9047\u5230\u95ee\u9898\uff0c\u53ef\u4ee5\u6309\u7167\u7ed9\u51fa\u7684\u63d0\u793a\u8fdb\u884c\u5904\u7406\u3002<\/p>\n<p>\u5178\u578b\u95ee\u9898\u53ca\u89e3\u51b3\u529e\u6cd5\u5982\u4e0b\uff1a<\/p>\n<p>1. No package \u2018sqlite3\u2019 found<\/p>\n<p># yum install libsqlite3x libsqlite3x-devel<br \/>\n2. No package \u2018libjpeg\u2019 found<\/p>\n<p># yum install libjpeg libjpeg-devel<br \/>\n3. No package \u2018oniguruma\u2019 found<\/p>\n<p># yum install oniguruma oniguruma-devel<br \/>\n\u7f16\u8bd1\u5b89\u88c5\u90fd\u6210\u529f\u540e\uff0c\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u4e3a PHP \u53ca php-fpm \u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<p># cp .\/php-7.4.1\/php.ini-production \/usr\/local\/lib\/php.ini<br \/>\n# cp \/usr\/local\/etc\/php-fpm.conf.default \/usr\/local\/etc\/php-fpm.conf<br \/>\n# cp \/usr\/local\/etc\/php-fpm.d\/www.conf.default \/usr\/local\/etc\/php-fpm.d\/www.conf<br \/>\n\u81f3\u6b64\uff0cCentOS 7 \u7cfb\u7edf\u5df2\u7ecf\u6210\u529f\u5b89\u88c5\u4e86 PHP 7.4.x\uff0c\u7406\u8bba\u4e0a\u53ef\u4ee5\u6b63\u5e38\u4f7f\u7528\u4e86\u3002<\/p>\n<p>\u542f\u7528\u6269\u5c55\u5219\u5728\u201dphp.ini\u201d\u6587\u4ef6\u4e2d\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n<p>extension=curl.so<br \/>\n\u5982\u679c\u4e4b\u524d\u5df2\u7ecf\u4f7f\u7528\u4e86 PHP 7.3 \u6216\u66f4\u65e9\u7684\u7248\u672c\uff0c\u66f4\u65b0\u5347\u7ea7\u4e5f\u5f88\u7b80\u5355\uff0c\u5c31\u662f\u7528\u65b0\u7f16\u8bd1\u597d\u7684\u201dphp-fpm\u201d\u6587\u4ef6\u66ff\u6362\u4e4b\u524d\u4f7f\u7528\u7684\u5373\u53ef\uff1a<\/p>\n<p># pkill -9 php-fpm<br \/>\n# cp .\/php-7.4.1\/sapi\/fpm\/php-fpm \/usr\/local\/sbin<br \/>\n# php-fpm<br \/>\n\u5982\u679c\u5728\u542f\u52a8 PHP \u540e\u51fa\u73b0\u7c7b\u4f3c\u201d PHP Startup: Unable to load dynamic library \u2018mysqli.so\u2019 \u201c\u7684\u544a\u8b66\u63d0\u793a\uff0c\u5219\u8bf4\u660e\u4e4b\u524d\u5728\u201dphp.ini\u201d\u6587\u4ef6\u4e2d\u914d\u7f6e\u542f\u7528\u7684\u6269\u5c55\u540c\u73b0\u7248\u672c PHP \u4e0d\u517c\u5bb9\uff0c\u4e0d\u80fd\u52a0\u8f7d\uff0c\u9700\u8981\u91cd\u65b0\u7f16\u8bd1\u5b89\u88c5\u73b0\u7248\u672c\u7684\u5bf9\u5e94\u6269\u5c55\u3002<\/p>\n<p>\u6269\u5c55\u91cd\u65b0\u7f16\u8bd1\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u91cd\u65b0\u542f\u52a8\u4e00\u6b21 php-fpm \u5373\u53ef\u3002<\/p>\n<p>\u603b\u4e4b\uff0cCentOS 7 \u7cfb\u7edf\u5b89\u88c5 PHP 7.4.x \u8fc7\u7a0b\u540c\u4e4b\u524d\u7248\u672c\u7c7b\u4f3c\uff0c\u5347\u7ea7\u4e5f\u6bd4\u8f83\u5bb9\u6613\u3002\u81f3\u4e8e\u8f6f\u4ef6\u5185\u90e8\u673a\u5236\u7684\u53d8\u5316\uff0c\u5bf9\u4e8e\u7f16\u8bd1\u5b89\u88c5\u4e5f\u5f71\u54cd\u4e0d\u5927\uff0c\u5e0c\u671b\u6709\u5174\u8da3\u7684\u670b\u53cb\u53ef\u4ee5\u5c1d\u8bd5\u4f7f\u7528 PHP 7.4.x\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP 7.4 \u6b63\u5f0f\u7248\u5df2\u7ecf\u53d1\u5e03\uff0c\u662f\u65f6\u5019\u5b89\u88c5\u5c1d\u9c9c\u4e86\u3002 \u9996\u5148\u4e0b\u8f7d\u6e90\u4ee3\u7801\u5305\u5e76\u89e3\u538b\uff1a # wget https:\/\/w [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":732,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[134,133,132],"class_list":["post-731","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-centos-7","tag-php","tag-php7-4","clear"],"_links":{"self":[{"href":"http:\/\/www.shenmdyw.com\/index.php\/wp-json\/wp\/v2\/posts\/731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.shenmdyw.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.shenmdyw.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.shenmdyw.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.shenmdyw.com\/index.php\/wp-json\/wp\/v2\/comments?post=731"}],"version-history":[{"count":3,"href":"http:\/\/www.shenmdyw.com\/index.php\/wp-json\/wp\/v2\/posts\/731\/revisions"}],"predecessor-version":[{"id":735,"href":"http:\/\/www.shenmdyw.com\/index.php\/wp-json\/wp\/v2\/posts\/731\/revisions\/735"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.shenmdyw.com\/index.php\/wp-json\/wp\/v2\/media\/732"}],"wp:attachment":[{"href":"http:\/\/www.shenmdyw.com\/index.php\/wp-json\/wp\/v2\/media?parent=731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.shenmdyw.com\/index.php\/wp-json\/wp\/v2\/categories?post=731"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.shenmdyw.com\/index.php\/wp-json\/wp\/v2\/tags?post=731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}