{"id":1654,"date":"2023-03-25T21:57:55","date_gmt":"2023-03-25T13:57:55","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1654"},"modified":"2023-04-23T21:55:37","modified_gmt":"2023-04-23T13:55:37","slug":"php-compilation-installation-zip-dependency","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/25\/php-compilation-installation-zip-dependency\/","title":{"rendered":"PHP\u7f16\u8bd1\u5b89\u88c5zip\u4f9d\u8d56"},"content":{"rendered":"<p>\u5b98\u65b9\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"http:\/\/pecl.php.net\/package\/zip\">http:\/\/pecl.php.net\/package\/zip<\/a><\/p>\n<pre><code class=\"language-bash\"># wget http:\/\/pecl.php.net\/get\/zip-1.17.2.tgz\n# tar -zxf zip-1.17.2.tgz \n# cd zip-1.17.2\/\n# \/data\/server\/php7\/bin\/phpize\n# .\/configure --with-php-config=\/data\/server\/php7\/bin\/php-config\n# make\n# make install<\/code><\/pre>\n<p><!-- more --><\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u5728<code>php.ini<\/code>\u914d\u7f6e\u6587\u4ef6Dynamic Extensions\u4e2d\uff0c\u6dfb\u52a0\uff1a<\/p>\n<pre><code>extension=zip.so<\/code><\/pre>\n<p>\u91cd\u542fPHP\u5373\u53ef<\/p>\n<p>\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u63d0\u793a<code>libzip<\/code>\u7248\u672c\u5fc5\u987b<code>&gt;=0.11<\/code>\u7248\uff0c\u90a3\u5c31\u9700\u8981\u5148\u7f16\u8bd1\u5b89\u88c5\u65b0\u7248\u7684<code>libzip<\/code><\/p>\n<p>\u5b89\u88c5\u6700\u65b0\u7684<code>libzip<\/code>\u3002\u4f7f\u7528yum\u5b89\u88c5<code>libzip<\/code>\u53ea\u80fd\u5b89\u88c5\u5230<code>0.10.*<\/code>\u7248\uff0c\u6240\u4ee5\u53ea\u80fd\u624b\u52a8\u5b89\u88c5\uff0c\u7f16\u8bd1\u9700\u8981CMake3<\/p>\n<pre><code class=\"language-bash\"># wget https:\/\/nih.at\/libzip\/libzip-1.5.2.tar.gz (https:\/\/libzip.org\/download\/libzip-1.5.2.tar.gz)\n# tar -zxf libzip-1.5.2.tar.gz\n# cd libzip*\n# mkdir build\n# cd build\n# cmake ..\n# make\n# make install<\/code><\/pre>\n<p>\u5982\u679c\u62a5\u9519\uff0c\u63d0\u9192Cmake\u7684\u7248\u672c\u53f7\u9700\u8981<code>&gt;2.8<\/code>\uff0c\u90a3\u5c31\u9700\u8981\u5148\u7f16\u8bd1\u5b89\u88c5CMake3\u3002\u7f16\u8bd1\u65f6\u95f4\u4f1a\u5f88\u957f\u2026\u2026<\/p>\n<pre><code class=\"language-bash\">#\u4ece\u8fd9\u4e0b\u8f7dCMake3\n# wget https:\/\/cmake.org\/files\/v3.13\/cmake-3.13.2.tar.gz\n\n# tar -zxf cmake-3.13.2.tar.gz\n# cd cmake-3.*\n# .\/bootstrap\n# gmake\n# gmake install\n\n#\u68c0\u67e5cmake\u7684\u7248\u672c\u53f7\n# cmake --version\n#\u5982\u679c\u4e0d\u80fd\u8bc6\u522bcmake\n# vim \/etc\/profile\n#\u5728\u6587\u4ef6\u672b\u5c3e\u5904\u589e\u52a0\u4ee5\u4e0b\u4ee3\u7801\n# export CMAKE_HOME=\/cmake\u7684\u6587\u4ef6\u5939\u8def\u5f84\n# export PATH=$PATH:$CMAKE_HOME\/bin\n#\u9000\u51favi\uff0c\u66f4\u65b0profile\n# source \/etc\/profile\n#\u518d\u6b21\u68c0\u67e5cmake\u7684\u7248\u672c\u53f7\n# cmake --version<\/code><\/pre>\n<p>\u5b89\u88c5\u5b8cCmake3\u540e\uff0c\u5728\u91cd\u65b0\u8fdb\u5165\u5230libzip\u6587\u4ef6\u5939\u5185\uff0c\u8fd0\u884c<code>mkdir build &amp;&amp; cd build &amp;&amp; cmake .. &amp;&amp; make &amp;&amp; make install<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b98\u65b9\uff1ahttp:\/\/pecl.php.net\/package\/zip # wget http:\/\/pecl.p [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[364],"class_list":["post-1654","post","type-post","status-publish","format-standard","hentry","category-devops-base","tag-libzip"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1654","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1654"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1654\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}