{"id":27617,"date":"2024-11-24T19:44:34","date_gmt":"2024-11-24T11:44:34","guid":{"rendered":"https:\/\/fwq.ai\/blog\/?p=27617"},"modified":"2024-11-24T19:44:34","modified_gmt":"2024-11-24T11:44:34","slug":"php7%e7%9a%84%e5%ae%89%e8%a3%85%e4%bb%a5%e5%8f%8a%e7%bc%96%e8%af%91%e4%b8%ad%e7%9a%84%e9%94%99%e8%af%af","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27617\/","title":{"rendered":"php7\u7684\u5b89\u88c5\u4ee5\u53ca\u7f16\u8bd1\u4e2d\u7684\u9519\u8bef"},"content":{"rendered":"<p><strong>1\u3001\u4e0b\u8f7d\u5730\u5740\uff1ahttp:\/\/idc.net\/downloads.php<\/strong><\/p>\n<p><strong>2\u3001configure\u7684\u914d\u7f6e\u5982\u4e0b\uff1a<\/strong><\/p>\n<p>.\/configure \u2013prefix=\/usr\/local\/php7 -with-config-file-path=\/usr\/local\/php7\/etc -with-mcrypt=\/usr\/local\/libmcrypt -with-mysqli=mysqlnd -with-pdo-mysql=mysqlnd -with-gd -with-iconv -with-zlib -enable-xml -enable-bcmath -enable-shmop -enable-sysvsem -enable-inline-optimization -enable-mbregex -enable-fpm -enable-mbstring -enable-ftp -enable-gd-native-ttf -with-openssl -enable-pcntl -enable-sockets -with-xmlrpc -enable-zip -enable-soap -without-pear -with-gettext -enable-session -with-curl -with-jpeg-dir -with-freetype-dir -enable-opcache \u2013with-readline<\/p>\n<p>\u7f16\u8bd1PHP8:<\/p>\n<p>.\/configure \u2013prefix=\/usr\/local\/php8 \u2013with-config-file-path=\/usr\/local\/php8\/etc \u2013with-mysqli=mysqlnd \u2013with-pdo-mysql=mysqlnd \u2013with-iconv \u2013with-zlib \u2013enable-xml \u2013enable-bcmath \u2013enable-shmop \u2013enable-sysvsem \u2013enable-mbregex \u2013enable-fpm \u2013enable-mbstring \u2013enable-ftp \u2013with-openssl \u2013enable-pcntl \u2013enable-sockets \u2013enable-soap \u2013without-pear \u2013with-gettext \u2013enable-session \u2013with-curl \u2013enable-opcache \u2013with-readline \u2013enable-cgi<br \/>\n\u2013enable-pdo \u2013with-mhash<\/p>\n<p>&nbsp;<\/p>\n<p><strong>1\u3001configure: error: no acceptable C compiler found in $PATH<\/strong><\/p>\n<pre>#\u5b89\u88c5gcc\u7f16\u8bd1 \r\nyum install -y gcc.x86_64<\/pre>\n<p><strong>2\u3001configure: error: xml2-config not found. Please check your libxml2 installation.<\/strong><\/p>\n<pre>#\u5b89\u88c5libxml2\r\nyum install -y libxml2.x86_64 libxml2-devel.x86_64<\/pre>\n<p><strong>3\u3001configure: error: Cannot find OpenSSL\u2019s &lt;evp.h&gt;<\/strong><\/p>\n<pre>\uff03\u5b89\u88c5openSSL\r\nyum install -y openssl.x86_64 openssl-devel.x86_64<\/pre>\n<p><strong>4\u3001error: Please reinstall the libcurl distribution &#8211;<\/strong><br \/>\n<strong>\u00a0 \u00a0\u00a0 easy.h should be in &lt;curl-dir&gt;\/include\/curl\/<\/strong><\/p>\n<pre>yum install -y libcurl.x86_64 libcurl-devel.x86_64<\/pre>\n<p><strong>5\u3001fails try \u2013with-webp-dir=&lt;DIR&gt;<\/strong><br \/>\n<strong>\u00a0\u00a0\u00a0\u00a0 error: jpeglib.h not found<\/strong><\/p>\n<pre>#\u5b89\u88c5gd\u5e93\r\nyum install -y gd.x86_64 gd-devel.x86_64<\/pre>\n<p><strong>6\u3001configure: error: mcrypt.h not found. Please reinstall libmcrypt.<\/strong><\/p>\n<pre>\u4e0b\u8f7d\u5b89\u88c5\uff1ahttps:\/\/sourceforge.net\/projects\/mcrypt\/files\/Libmcrypt\/2.5.8\/\r\n\r\ntar zxf libmcrypt-2.5.8.tar.gz\r\ncd libmcrypt-2.5.8\r\n\u00a0.\/configure\u00a0 --prefix=\/usr\/local\/libmcrypt \/\/\u76ee\u5f55\u548cphp\u7684configure\u4e2d\u7684\u4fdd\u6301\u4e00\u81f4 \r\n\/\/--with-mcrypt=\/usr\/local\/libmcrypt\/include\r\n# make\r\n# make install\r\n\r\n\u9047\u5230\u9519\u8bef\uff1a\r\nerror: C++ compiler cannot create executables\r\n\u89e3\u51b3\uff1ayum install -y gcc-c++.x86_64<\/pre>\n<p><strong>7\u3001WARNING: unrecognized options: \u2013with-mysql<\/strong><\/p>\n<pre>\uff03php 7\u4e0d\u5728\u652f\u6301mysql\r\n.\/configure\u4e2d\u79fb\u9664 --with-mysql \r\n<\/pre>\n<p><strong>8\u3001Package requirements (sqlite3 &gt;= 3.7.7) were not met<\/strong><\/p>\n<pre class=\"p1\"><span class=\"s1\"># yum install sqlite-devel<\/span><\/pre>\n<p class=\"p1\"><strong>9\u3001configure: error: Package requirements (oniguruma) were not met:<\/strong><\/p>\n<pre class=\"p1\"><span class=\"s1\"># <\/span>yum install -y oniguruma.x86_64<span class=\"Apple-converted-space\">\u00a0 <\/span>oniguruma-devel.x86_64<\/pre>\n<p><strong>8\u3001\u5b89\u88c5\u7684\u64cd\u4f5c<\/strong><\/p>\n<pre>tar -zxf php-7.0.13.tar.gz\r\ncd php-7.0.13\r\n.\/configur ---\u53c2\u8003\u4e0a\u6587\r\nmake --\u8fd9\u4e2a\u65f6\u95f4\u6bd4\u8f83\u957f\r\nmake install\r\n\r\ncp\u00a0 php.ini-production \/usr\/local\/php7\/etc\/php.ini\r\ncp sapi\/fpm\/init.d.php-fpm \/usr\/local\/php7\/etc\/init.d.php-fpm \/\/\u5907\u7528\r\nmv \/usr\/local\/php7\/etc\/php-fpm.conf.default \/usr\/local\/php7\/etc\/php-fpm.conf\r\nmv \/usr\/local\/php7\/etc\/php-fpm.d\/www.conf.default \/usr\/local\/php7\/etc\/php-fpm.d\/www.conf<\/pre>\n<p><strong>\u00a09\u3001<\/strong><strong>\u5b89\u88c5mongodb\u6269\u5c55\uff08php7\u79cd\u5df2\u5e9f\u5f03mongo\u7684\u6269\u5c55\uff09<\/strong><\/p>\n<pre>#\u5fc5\u987b\u5148\u5b89\u88c5git ,\u4f7f\u7528yum install git.x86_64\r\n# git clone https:\/\/github.com\/mongodb\/mongo-php-driver.git\r\n# git submodule sync &amp;&amp; git submodule update --init\r\n# .\/configure --with-php-config=\/usr\/local\/php7\/bin\/php-config \/\/\u6ce8\u610f\u662fphp-config\u7684\u5b8c\u6574\u8def\u5f84\r\n# make\r\n# make install\r\n\r\n\u5b89\u88c5\u6210\u529f\u540e\u663e\u793a\uff1a\r\nInstalling shared extensions:\u00a0\u00a0\u00a0\u00a0 \r\n\/usr\/local\/php7\/lib\/php\/extensions\/no-debug-non-zts-20151012\/\r\n\r\n\u67e5\u770bphp\u7684\u6269\u5c55so\u7684\u9ed8\u8ba4\u76ee\u5f55\r\n# \/usr\/local\/php7\/bin\/php -i | grep extension_dir\r\n\u663e\u793a\uff1aextension_dir =&gt; \/usr\/local\/php7\/lib\/php\/extensions\/no-debug-non-zts-20151012 \r\n=&gt; \/usr\/local\/php7\/lib\/php\/extensions\/no-debug-non-zts-20151012\r\n\r\n\u4e24\u4e2a\u76ee\u5f55\u4e00\u81f4\uff0c\u76f4\u63a5\u5728php.ini\u6587\u4ef6\u6dfb\u52a0\uff1aextension=mongodb.so\r\n\r\n\u9519\u8bef\uff1a\r\nconfigure: error: Cannot find php-config. Please use --with-php-config=PATH\r\n\u89e3\u51b3\uff1a\r\n.\/configure --with-php-config=\/usr\/local\/php7\/bin\/php-config \/\/\u6ce8\u610f\u662fphp-config\u7684\u5b8c\u6574\u8def\u5f84<\/pre>\n<p><strong>10\u3001configure: error: Please reinstall readline \u2013 I cannot find readline.h<\/strong><\/p>\n<pre>\u89e3\u51b3\uff1a\r\nyum install -y readline.x86_64 readline-devel.x86_64<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u4e0b\u8f7d\u5730\u5740\uff1ahttp:\/\/idc.net\/downloads.php 2\u3001configure\u7684\u914d\u7f6e\u5982\u4e0b\uff1a .\/configure \u2013prefix=\/usr\/local\/php7 -with-config-file-path=\/usr\/local\/php7\/etc -with-mcrypt=\/usr\/local\/libmcrypt -with-mysqli=mysqlnd -with-pdo-mysql=mysqlnd -with-gd -with-iconv -with-zlib -enable-xml -enable-bcmath -enable-shmop -enable-sysvsem -enable-inline-optimization -enable-mbregex -enable-fpm -enable-mbstring -enable-ftp -enable-gd-native-ttf -with-openssl -enable-pcntl -enable-sockets -with-xmlrpc -enable-zip -enable-soap -without-pear -with-gettext -enable-session -with-curl -with-jpeg-dir -with-freetype-dir -enable-opcache \u2013with-readline \u7f16\u8bd1PHP8: .\/configure \u2013prefix=\/usr\/local\/php8 \u2013with-config-file-path=\/usr\/local\/php8\/etc \u2013with-mysqli=mysqlnd \u2013with-pdo-mysql=mysqlnd \u2013with-iconv \u2013with-zlib \u2013enable-xml \u2013enable-bcmath \u2013enable-shmop \u2013enable-sysvsem \u2013enable-mbregex \u2013enable-fpm \u2013enable-mbstring \u2013enable-ftp \u2013with-openssl \u2013enable-pcntl \u2013enable-sockets \u2013enable-soap [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-27617","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27617","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=27617"}],"version-history":[{"count":1,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27617\/revisions"}],"predecessor-version":[{"id":27628,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27617\/revisions\/27628"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27617"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}