{"id":154,"date":"2020-02-15T17:11:27","date_gmt":"2020-02-15T09:11:27","guid":{"rendered":"\/\/hqidi.com\/?p=154"},"modified":"2020-02-15T17:11:27","modified_gmt":"2020-02-15T09:11:27","slug":"php-7-4-checking-for-libzip-%e5%92%8c-failed-to-open-error_log-%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/hqidi.com\/154.html","title":{"rendered":"PHP 7.4 checking for libzip \u548c failed to open error_log \u95ee\u9898"},"content":{"rendered":"<p>\u4e24\u4e2a\u6df1\u5751\uff0c\u6210\u5e74\u963f\u6839\u5ef7\u9f99\u8e29\u51fa\u6765\u7684\u5751\uff0c\u7f51\u4e0a\u90fd\u6ca1\u627e\u5230\u89e3\u51b3\u65b9\u6cd5\uff0c\u90fd\u662f\u81ea\u5df1\u6478\u7d22\u51fa\u6765\u7684\u3002<\/p>\n<p>\u524d\u9762\u4e00\u5207\u987a\u5229\uff1a<\/p>\n<pre class=\"prettyprint\">yum install -y libxml2 libxml2-devel libxml2-python curl curl-devel libjpeg libjpeg-devel libpng  libpng-devel freetype-devel libmcrypt libmcrypt-devel gd gd-devel gcc-c++ gcc openssl openssl-devel  libsqlite3x-devel oniguruma-devel libicu-devel\n\nwget https:\/\/www.php.net\/distributions\/php-7.4.2.tar.gz\ntar xf php-7.4.2.tar.gz \ncd php-7.4.2\n.\/configure --prefix=\/usr\/local\/php --enable-opcache --with-config-file-path=\/usr\/local\/php\/etc --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-fpm --enable-static --enable-inline-optimization --enable-sockets  --with-zip --enable-calendar --enable-bcmath --enable-soap --enable-mbstring --with-zlib --with-iconv --enable-gd --with-xmlrpc --enable-mbstring --with-curl --with-freetype --with-mysql-sock=\/var\/lib\/mysql\/mysql.sock   --disable-ipv6 --disable-debug --with-openssl --disable-maintainer-zts --enable-intl\n<\/pre>\n<p>\u81f3\u4e8econfigure\u7684\u65f6\u5019\uff0c\u914d\u7f6e\u53c2\u6570\u7684\u53d8\u66f4\u3001\u5f03\u7528\u7b49\u8fd9\u79cd\u5c0f\u95ee\u9898\u5c31\u4e0d\u8bf4\u4e86\u3002<\/p>\n<h3>No package 'libzip' found<\/h3>\n<p>\u6211\u4e0d\u77e5\u9053\u7f51\u4e0a\u7684\u6559\u7a0b\u662f\u600e\u4e48\u56de\u4e8b\uff0c\u53cd\u6b63\u5728centos7+PHP 7.4.2 \u73af\u5883\u4e0b\uff0c\u7f51\u4e0a\u7684\u6240\u6709\u6559\u7a0b\u90fd\u4e0d\u5bf9\uff0c<span style=\"color: #ff0000;\">\u4e00\u4e2a\u90fd\u4e0d\u5bf9<\/span><br \/>\n\u8fd9\u4e2a\u95ee\u9898\u7684\u5b8c\u6574\u62a5\u9519\u5982\u4e0b\uff1a<\/p>\n<pre class=\"prettyprint\">checking for libzip &gt;= 0.11... no\nconfigure: error: Package requirements (libzip &gt;= 0.11) were not met:\n\nNo package 'libzip' found\n\nConsider adjusting the PKG_CONFIG_PATH environment variable if you\ninstalled software in a non-standard prefix.\n\nAlternatively, you may set the environment variables LIBZIP_CFLAGS\nand LIBZIP_LIBS to avoid the need to call pkg-config.\nSee the pkg-config man page for more details.\n<\/pre>\n<p>\u62a5\u9519\u63d0\u793a\u975e\u5e38\u660e\u663e\uff0c\u914d\u7f6e\u7a0b\u5e8f\u6ca1\u6709\u627e\u5230libzip\u5e93\uff0c\u4f60\u7528yum\u5b89\u88c5libzip-devel\u7684\u8bdd\uff0c\u5b89\u88c5\u7684\u7248\u672c\u662f0.10\uff0c\u7248\u672c\u8fbe\u4e0d\u5230\u8981\u6c42\u3002\u6240\u4ee5\uff0c\u6b64\u65f6\u6211\u4eec\u9700\u8981\u5378\u8f7d\u6389yum\u5b89\u88c5\u7684libzip\u7136\u540e\u624b\u52a8\u5b89\u88c5\u65b0\u7248\u3002<\/p>\n<pre class=\"prettyprint\">yum remove libzip libzip-devel\nwget https:\/\/hqidi.com\/big\/libzip-1.2.0.tar.gz\ntar -zxvf libzip-1.2.0.tar.gz\ncd libzip-1.2.0\n.\/configure\nmake &amp;&amp; make install\n<\/pre>\n<p>\u5728\u7f51\u4e0a\u627e\u5230\u7684\u6559\u7a0b\u5230\u4e86\u8fd9\u4e00\u6b65\u5c31\u76f4\u63a5\u8ba9\u4f60\u7ee7\u7eed\u5728PHP\u6e90\u7801\u76ee\u5f55\u91cc\u9762\u6267\u884cconfigure\u7a0b\u5e8f\u7ee7\u7eed\u914d\u7f6e\u4e86\uff0c\u5176\u5b9e\u4f60\u867d\u7136\u5df2\u7ecf\u5b89\u88c5\u4e86libzip1.2\uff0c\u4f46\u662fPHP\u7684configure\u7a0b\u5e8f\u4f9d\u7136\u627e\u4e0d\u5230\uff0c\u4e0d\u77e5\u9053\u4f60\u5b89\u88c5\u5728\u54ea\uff0c\u4f60\u5f97\u544a\u8bc9PHP\u7684configure\u7a0b\u5e8f\uff0c\u6211\u5b89\u88c5\u4e86libzip 1.2\uff0c\u5e76\u4e14\u5b89\u88c5\u5728\u4f55\u5904\u3002\u4ee5\u524d\u662f\u7528ldconfig\u6765\u901a\u544a\u7cfb\u7edf\u6240\u9700\u52a8\u6001\u5e93\u6587\u4ef6\u7684\u4f4d\u7f6e\uff0c\u73b0\u5728\u7528pkg-config\u3002<br \/>\n\u6211\u521a\u521a\u63d0\u4f9b\u7684\u65b9\u6cd5\u5b89\u88c5\u7684libzip\u9ed8\u8ba4\u88ab\u5b89\u88c5\u5230\u4e86 \/usr\/local\/lib \u5728\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u4f60\u80fd\u770b\u5230libzip.so libzip.so.5 libzip.so.5.0.0 \u8fd8\u6709\u4e00\u4e2apkgconfig\u76ee\u5f55\u3002<br \/>\n\u6240\u4ee5\uff0c\u771f\u6b63\u7684\u89e3\u51b3\u65b9\u6cd5\u6765\u4e86\uff0c\u5728\u4f60configure\u7684\u4f1a\u8bdd\u7a97\u53e3\u76f4\u63a5\u8f93\u5165\u5982\u4e0b\u5185\u5bb9\uff1a<br \/>\nexport PKG_CONFIG_PATH=\"\/usr\/local\/lib\/pkgconfig\/\"<br \/>\n\u4e0a\u9762\u547d\u4ee4\u7684\u4f5c\u7528\u5c31\u662f\u544a\u8bc9configure\u7a0b\u5e8f\uff0c\u53bb\/usr\/local\/lib \u76ee\u5f55\u4e0b\u627e\u5e93\u6587\u4ef6\uff0c\u8fd9\u6837\u4ed6\u5c31\u80fd\u627e\u5230libzip.so<br \/>\n\u6b64\u65f6\uff0c\u4f60\u7ee7\u7eed.\/configure\u5c06\u4f1a\u5f88\u987a\u5229\u7684\u770b\u5230<br \/>\nThank you for using PHP.<\/p>\n<h3>PHP7\u62a5\u9519Read-only file system (30)<\/h3>\n<p>\u5f53\u4f60\u7167\u7740 <a href=\"https:\/\/hqidi.com\/51.html\">\u6b64\u6587<\/a> \u5b89\u88c5\u597dPHP\uff0c\u5e76\u505a\u597dsystemd\u670d\u52a1\u7ba1\u7406\u6587\u4ef6\uff0c\u4f60\u4f1a\u53d1\u73b0\u7528systemctl start php-fpm \u65e0\u6cd5\u6b63\u5e38\u542f\u52a8php-fpm \u62a5\u4e86\u4e00\u4e2a\u5f88\u5947\u602a\u7684\u9519\u3002<br \/>\nERROR: failed to open error_log (\/usr\/local\/php\/var\/log\/php-fpm.log): Read-only file system (30)<br \/>\n\u6b64\u65f6\uff0cselinux\u662f\u5173\u95ed\u72b6\u6001\uff0c\u666e\u901a\u7528\u6237\u5bf9\u8fd9\u4e2a\u6587\u4ef6\u4e5f\u53ef\u5199\uff0c\u95ee\u9898\u5c31\u8ff7\u79bb\u4e86\u3002<br \/>\n\u89e3\u51b3\u65b9\u6cd5\uff1a<br \/>\n\u6253\u5f00 \/usr\/lib\/systemd\/system\/php-fpm.service \u628a<br \/>\nProtectSystem=true<br \/>\n\u6539\u6210<br \/>\nProtectSystem=false<\/p>\n<p>\u5f53\u8fd9\u4e2a\u503c\u4e3atrue\u7684\u65f6\u5019\uff0cphp-fpm\u8fdb\u7a0b\u5c06\u4ee5\u53ea\u8bfb\u7684\u65b9\u5f0f\u6302\u8f7d \/usr \u76ee\u5f55\uff0c\u8fd9\u5c31\u662f\u95ee\u9898\u6240\u5728\u3002\u5177\u4f53\u53ef\u53c2\u8003<br \/>\nhttps:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.exec.html#ProtectSystem=<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e24\u4e2a\u6df1\u5751\uff0c\u6210\u5e74\u963f\u6839\u5ef7\u9f99\u8e29\u51fa\u6765\u7684\u5751\uff0c\u7f51\u4e0a\u90fd\u6ca1\u627e\u5230\u89e3\u51b3\u65b9\u6cd5\uff0c\u90fd\u662f\u81ea\u5df1\u6478\u7d22\u51fa\u6765\u7684\u3002 \u524d\u9762\u4e00\u5207\u987a\u5229\uff1a yum install -y libxml2 libxml2-devel libxml2-python curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype-devel libmcryp...<\/p>\n<a class=\"read-more\" href=\"https:\/\/hqidi.com\/154.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":[31],"class_list":["post-154","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-study","tag-php7"],"_links":{"self":[{"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts\/154"}],"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=154"}],"version-history":[{"count":1,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts\/154\/revisions"}],"predecessor-version":[{"id":4125,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/posts\/154\/revisions\/4125"}],"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=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/categories?post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hqidi.com\/wp-json\/wp\/v2\/tags?post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}