{"id":150,"date":"2019-11-29T14:50:12","date_gmt":"2019-11-29T06:50:12","guid":{"rendered":"\/\/hqidi.com\/?p=150"},"modified":"2019-11-29T14:50:12","modified_gmt":"2019-11-29T06:50:12","slug":"%e7%bc%96%e8%af%91%e5%8d%87%e7%ba%a7php-7-4-0","status":"publish","type":"post","link":"https:\/\/hqidi.com\/150.html","title":{"rendered":"\u7f16\u8bd1\u5347\u7ea7PHP 7.4.0"},"content":{"rendered":"<h3>\u5907\u4efd\u5f53\u524d\u7248\u672c<\/h3>\n<p>\u5b89\u5168\u7b2c\u4e00\uff0c\u4e0d\u5fd8\u5907\u4efd<\/p>\n<pre class=\"prettyprint\" >\r\nwhich php\r\n\/usr\/local\/php\/bin\/php\r\ncp -r \/usr\/local\/php \/usr\/local\/php_bak\r\n<\/pre>\n<h3>\u83b7\u53d6\u5f53\u524d PHP \u914d\u7f6e\u53c2\u6570<\/h3>\n<p>\u6211\u662f\u76f4\u63a5\u5728\u5386\u53f2\u547d\u4ee4\u91cc\u9762\u627e\u5230\u7684\uff1a<br \/>\n history |grep configure<br \/>\n\u5982\u679c\u4f60\u627e\u4e0d\u5230\u5c31\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u627e\uff1a<\/p>\n<p>\/usr\/local\/php\/bin\/php -i | head<\/p>\n<p>\u603b\u4e4b\uff0c\u6211\u4eec\u9700\u8981\u7684\u5c31\u662f\u4e0b\u9762\u7684\u4e1c\u897f\uff1a<\/p>\n<p>.\/configure --prefix=\/usr\/local\/php --enable-opcache --with-config-file-path=\/usr\/local\/php\/etc --with-curl --enable-fpm  --with-gd --with-iconv --enable-mbstring --with-mysqli=mysqlnd --with-openssl --enable-static --enable-sockets --enable-inline-optimization --with-zlib --disable-ipv6 --disable-fileinfo --disable-debug<\/p>\n<p>\u8fd9\u91cc\u8981\u6ce8\u610f\uff0c\u6c14\u6b7b\u4f60\u7684PHP\u7248\u672c\u91cc\u9762(7.4.0)<span style=\"color: #ff0000;\">\u5df2\u7ecf\u4e0d\u652f\u6301\u201c--with-gd\u201d\uff0c\u5f97\u6539\u6210\u201c--enable-gd\u201d<\/span>\uff0c\u5426\u5219\u4f1a\u62a5\u9519\u201cGD Library Error: imagecreatetruecolor does not exist - please contact your webhost and ask them to install the GD library<br \/>\n\u201d\u6240\u4ee5\u6700\u7ec8\u6211\u4eec\u5f97\u5230\u7684\u914d\u7f6e\u53c2\u6570\u4e3a\uff1a<\/p>\n<p>.\/configure --prefix=\/usr\/local\/php --enable-opcache --with-config-file-path=\/usr\/local\/php\/etc --with-curl --enable-fpm  --enable-gd --with-iconv --enable-mbstring --with-mysqli=mysqlnd --with-openssl --enable-static --enable-sockets --enable-inline-optimization --with-zlib --disable-ipv6 --disable-fileinfo --disable-debug<\/p>\n<h3>\u4e0b\u8f7dPHP<\/h3>\n<p>\u4ece https:\/\/www.php.net\/downloads.php \u9875\u9762\u4e0b\u8f7d PHP \u7684\u6700\u65b0 Stable \u7248\u672c\uff0c\u89e3\u538b\u7f29\uff0c\u8fdb\u5165\u6e90\u7801\u76ee\u5f55\u3002<\/p>\n<pre class=\"prettyprint\" >\r\nwget https:\/\/www.php.net\/distributions\/php-7.4.0.tar.gz\r\ntar xf php-7.4.0.tar.gz \r\ncd php-7.4.0\r\n<\/pre>\n<h3>\u914d\u7f6ePHP<\/h3>\n<p>\u5728\u7f16\u8bd1\u4e4b\u524d\uff0c\u9700\u8981\u8fdb\u5165\u6e90\u4ee3\u7801\u76ee\u5f55\uff0c\u5bf9\u8981\u5b89\u88c5\u7684\u7a0b\u5e8f\u8fdb\u884c\u5404\u79cd\u53c2\u6570\u914d\u7f6e\uff0c\u6bd4\u5982\u5b89\u88c5\u5230\u4ec0\u4e48\u5730\u65b9\uff0c\u9700\u8981\u5f00\u542f\u54ea\u4e9b\u529f\u80fd\u7b49\u3002\u914d\u7f6e\u5de5\u4f5c\u4e00\u822c\u90fd\u7531\u6e90\u7801\u76ee\u5f55\u4e2d\u7684configure\u811a\u672c\u5b8c\u6210\u3002<\/p>\n<pre class=\"prettyprint\" >\r\n.\/configure --prefix=\/usr\/local\/php --enable-opcache --with-config-file-path=\/usr\/local\/php\/etc --with-curl --enable-fpm  --enable-gd --with-iconv --enable-mbstring --with-mysqli=mysqlnd --with-openssl --enable-static --enable-sockets --enable-inline-optimization --with-zlib --disable-ipv6 --disable-fileinfo --disable-debug\r\n<\/pre>\n<h4>error: Package requirements (sqlite3 > 3.7.4) were not met<\/h4>\n<p>error: Package requirements (sqlite3 > 3.7.4) were not met<br \/>\nNo package 'sqlite3' found<br \/>\n\u82e5\u770b\u5230\u4e0a\u9762\u7684\u62a5\u9519\uff0c\u975e\u5e38\u7b80\u5355\uff1a<br \/>\nyum install libsqlite3x-devel -y<\/p>\n<h4>error: Package requirements (oniguruma) were not met<\/h4>\n<p>error: Package requirements (oniguruma) were not met<br \/>\nNo package 'oniguruma' found<br \/>\n\u82e5\u770b\u5230\u4e0a\u9762\u7684\u62a5\u9519\uff0c\u975e\u5e38\u7b80\u5355\uff1a<br \/>\nyum install oniguruma-devel -y<\/p>\n<h3>\u7f16\u8bd1PHP<\/h3>\n<p>\u521a\u624d\u7684\u914d\u7f6e\u901a\u8fc7\u540e\uff0c\u76f4\u63a5\u8fd0\u884c make \u8fdb\u884c\u7f16\u8bd1\u3002<\/p>\n<h3>\u5b89\u88c5PHP<\/h3>\n<p>\u521a\u624d\u7684\u7f16\u8bd1\u901a\u8fc7\u540e\uff0c\u5148\u505c\u6b62PHP-FPM\u670d\u52a1\uff1a<br \/>\nsystemctl stop php-fpm<br \/>\n\u7136\u540e\u8fd0\u884c make install \u8fdb\u884c\u5b89\u88c5\uff0c\u5b89\u88c5\u6210\u529f\u540e\uff0c\u6211\u4eec\u5f97\u6539\u4e0bphp.ini\u6587\u4ef6\uff0c\u8be5\u6587\u4ef6\u91cc\u9762\u7684<br \/>\nzend_extension=\"\/usr\/local\/php\/lib\/php\/extensions\/no-debug-non-zts-20170718\/opcache.so\"<br \/>\n\u6539\u6210\uff1a<br \/>\nzend_extension=\"\/usr\/local\/php\/lib\/php\/extensions\/no-debug-non-zts-20190902\/opcache.so\"<br \/>\n\u6700\u540e\u542f\u52a8PHP-FPM\u670d\u52a1\uff1a<br \/>\nsystemctl start php-fpm<br \/>\n\u8fdb\u5165\u4f60\u7684\u7f51\u7ad9\u6839\u76ee\u5f55\u6267\u884c\uff1a<br \/>\necho \"&lt;?php phpinfo() ?&gt;\" &gt;d.php<br \/>\n\u7136\u540e\u8bbf\u95ee https:\/\/yoursite.com\/d.php \u6765\u68c0\u6d4b\u6b64\u5904\u5347\u7ea7\u7684\u7ed3\u679c\uff0c\u786e\u8ba4\u5347\u7ea7\u6210\u529f\u540e\u8bb0\u5f97\u5220\u9664 d.php<\/p>\n<p>\u66f4\u8be6\u7ec6\u7684\u5b89\u88c5\u6b65\u9aa4\u8bf7\u67e5\u770b\uff1a<br \/>\n<a href=\"https:\/\/hqidi.com\/51.html\" rel=\"noopener\" target=\"_blank\">Centos 6.5 x64\u5b89\u88c5php 7.2<\/a><br \/>\n<a href=\"https:\/\/hqidi.com\/129.html\" rel=\"noopener\" target=\"_blank\">PHP-FPM\u6ca1\u6709\u751f\u6210socket\u6587\u4ef6<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5907\u4efd\u5f53\u524d\u7248\u672c \u5b89\u5168\u7b2c\u4e00\uff0c\u4e0d\u5fd8\u5907\u4efd which php \/usr\/local\/php\/bin\/php cp -r \/usr\/local\/php \/usr\/local\/php_bak \u83b7\u53d6\u5f53\u524d PHP \u914d\u7f6e\u53c2\u6570 \u6211\u662f\u76f4\u63a5\u5728\u5386\u53f2\u547d\u4ee4\u91cc\u9762\u627e\u5230\u7684\uff1a history |grep configure \u5982\u679c\u4f60\u627e\u4e0d\u5230\u5c31\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u627e\uff1a \/usr\/local\/php\/bin\/p...<\/p>\n<a class=\"read-more\" href=\"https:\/\/hqidi.com\/150.html\">\u9605\u8bfb\u5168\u6587 &raquo;<\/a>","protected":false},"author":1,"featured_media":4068,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-150","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-study"],"_links":{"self":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts\/150"}],"collection":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/comments?post=150"}],"version-history":[{"count":5,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts\/150\/revisions"}],"predecessor-version":[{"id":4067,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts\/150\/revisions\/4067"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/media\/4068"}],"wp:attachment":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/media?parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/categories?post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/tags?post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}