php编译错误总结

编译出错

cURL

checking for strings.h... (cached) yes
checking io.h usability... no
checking io.h presence... no
checking for io.h... no
checking for strtoll... yes
checking for atoll... yes
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... /usr/bin/xml2-config
checking whether libxml build works... yes
checking for OpenSSL support... yes
checking for Kerberos support... no
checking whether to use system default cipher list instead of hardcoded value... no
checking for RAND_egd... no
checking for pkg-config... /usr/bin/pkg-config
checking for PCRE library to use... bundled
checking whether to enable PCRE JIT functionality... yes
checking whether to enable the SQLite3 extension... yes
checking bundled sqlite3 library... yes
checking for ZLIB support... yes
checking if the location of ZLIB install directory is defined... no
checking for zlib version >= 1.2.0.4... 1.2.7
checking for gzgets in -lz... yes
checking whether to enable bc style precision math functions... yes
checking for BZip2 support... yes
checking for BZip2 in default path... found in /usr
checking for BZ2_bzerror in -lbz2... yes
checking whether to enable calendar conversion support... no
checking whether to enable ctype functions... yes
checking for cURL support... yes
checking for libcurl.pc... using default path
checking for cURL 7.15.5 or greater... configure: error: cURL version 7.15.5 or later is required to compile php with cURL support

《php编译错误总结》
《php编译错误总结》

解决方案

 yum install curl curl-devel

OpenSSL

Configuring extensions
checking for strings.h... (cached) yes
checking io.h usability... no
checking io.h presence... no
checking for io.h... no
checking for strtoll... yes
checking for atoll... yes
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... /usr/bin/xml2-config
checking whether libxml build works... yes
checking for OpenSSL support... yes
checking for Kerberos support... no
checking whether to use system default cipher list instead of hardcoded value... no
checking for RAND_egd... no
checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>

《php编译错误总结》
《php编译错误总结》

解决方案

yum install -y openssl openssl-devel

C

checking for cc... no
checking for gcc... no
configure: error: in `/root/lnmp/php-7.2.16':
configure: error: no acceptable C compiler found in $PATH

《php编译错误总结》
《php编译错误总结》

解决:

 yum -y install gcc gcc-c++

libxml2

checking for strings.h... (cached) yes
checking io.h usability... no
checking io.h presence... no
checking for io.h... no
checking for strtoll... yes
checking for atoll... yes
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... 
checking for pkg-config... /usr/bin/pkg-config
configure: error: libxml2 not found. Please check your libxml2 installation.

《php编译错误总结》
《php编译错误总结》

解决

 yum -y install libxml2 libxml2-devel

png

checking whether to enable input filter support... yes
checking pcre install prefix... no
checking whether to enable FTP support... no
checking OpenSSL dir for FTP... no
checking for GD support... yes
checking for the location of libwebp... no
checking for the location of libjpeg... no
checking for the location of libpng... no
checking for the location of libXpm... no
checking for FreeType 2... yes
checking whether to enable JIS-mapped Japanese font support in GD... no
If configure fails try --with-webp-dir=<DIR>
If configure fails try --with-jpeg-dir=<DIR>
configure: error: png.h not found.

解决

yum -y install libpng libpng-devel

freetype-config

checking whether to enable input filter support... yes
checking pcre install prefix... no
checking whether to enable FTP support... no
checking OpenSSL dir for FTP... no
checking for GD support... yes
checking for the location of libwebp... no
checking for the location of libjpeg... no
checking for the location of libpng... no
checking for the location of libXpm... no
checking for FreeType 2... yes
checking whether to enable JIS-mapped Japanese font support in GD... no
If configure fails try --with-webp-dir=<DIR>
If configure fails try --with-jpeg-dir=<DIR>
checking for png_write_image in -lpng... yes
If configure fails try --with-xpm-dir=<DIR>
configure: error: freetype-config not found.

解决

yum -y install freetype-devel

ICU prefix or no failed

checking size of long long... (cached) 8
checking size of long int... 8
checking checking if we're at 64-bit platform... yes
checking for iconv support... yes
checking for iconv... yes
checking if iconv is glibc's... yes
checking if iconv supports errno... yes
checking if iconv supports //IGNORE... no
checking if your cpp allows macro usage in include lines... yes
checking for IMAP support... no
checking for IMAP Kerberos support... no
checking for IMAP SSL support... no
checking for Firebird support... no
checking whether to enable internationalization support... yes
checking for location of ICU headers and libraries... checking for icu-config... no
not found
configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.

《php编译错误总结》
《php编译错误总结》

解决

yum -y install libicu-devel

BZip2

checking for strings.h... (cached) yes
checking io.h usability... no
checking io.h presence... no
checking for io.h... no
checking for strtoll... yes
checking for atoll... yes
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... /usr/bin/xml2-config
checking whether libxml build works... yes
checking for OpenSSL support... yes
checking for Kerberos support... no
checking whether to use system default cipher list instead of hardcoded value... no
checking for RAND_egd... no
checking for pkg-config... /usr/bin/pkg-config
checking for PCRE library to use... bundled
checking whether to enable PCRE JIT functionality... yes
checking whether to enable the SQLite3 extension... yes
checking bundled sqlite3 library... yes
checking for ZLIB support... yes
checking if the location of ZLIB install directory is defined... no
checking for zlib version >= 1.2.0.4... 1.2.7
checking for gzgets in -lz... yes
checking whether to enable bc style precision math functions... yes
checking for BZip2 support... yes
checking for BZip2 in default path... not found
configure: error: Please reinstall the BZip2 distribution

《php编译错误总结》
《php编译错误总结》

解决

[root@VM_159_140_centos php-7.2.16]# yum -y install bzip2 bzip2-devel

libzip

checking whether libxml build works... (cached) yes
checking for XSL support... no
checking whether to enable zend-test extension... no
checking for zip archive read/writesupport... yes
checking pcre install prefix... no
checking libzip... yes
checking for the location of zlib... /usr
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for libzip... not found
configure: error: Please reinstall the libzip distribution

《php编译错误总结》
《php编译错误总结》

解决

[root@VM_159_140_centos lnmp]# wget https://nih.at/libzip/libzip-1.2.0.tar.gz
[root@VM_159_140_centos lnmp]# tar -zxvf libzip-1.2.0.tar.gz
[root@VM_159_140_centos lnmp]# cd libzip-1.2.0
[root@VM_159_140_centos lnmp]# ./configure
[root@VM_159_140_centos lnmp]# make
[root@VM_159_140_centos lnmp]# make install

其他编译错误

configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution

解决方案:

yum -y install libxslt-devel

configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.

解决方案:

yum -y install net-snmp-devel

configure: error: Please reinstall readline - I cannot find readline.h

解决方案:

yum -y install readline-devel

configure: error: Cannot find pspell

解决方案:

yum -y install aspell-devel

checking for unixODBC support... configure: error: ODBC header file '/usr/include/sqlext.h' not found!

解决方案:

yum -y install unixODBC-devel

configure: error: utf8mime2text() has new signature, but U8TCANONICAL is missing. This should not happen. Check config.log for additional information.

解决方案:

yum -y install libc-client-devel

configure: error: xpm.h not found.

解决方案:

yum -y install libXpm-devel

configure: error: vpx_codec.h not found.

解决方案:

yum -y install libvpx-devel

configure: error: Cannot find enchant

解决方案:

yum -y install enchant-devel

configure: error: Please reinstall the libcurl distribution - easy.h should be in /include/curl/

解决方案:

yum -y install libcurl-devel

configure: error: mcrypt.h not found. Please reinstall libmcrypt.

解决方案:

wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz
tar zxf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure
make && make install

Cannot find imap

解决方案:

ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so

configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing.

解决方案:

yum -y install libc-client-devel

Cannot find ldap.h

解决方案:

yum -y install openldap
yum -y install openldap-devel

configure: error: Cannot find ldap libraries in /usr/lib

解决方案:

cp -frp /usr/lib64/libldap* /usr/lib/

configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path

解决方案:

yum -y install postgresql-devel

configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.

解决方案:

yum -y install net-snmp-devel

configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution

解决方案:

yum -y install libxslt-devel

checking for curl_multi_strerror in -lcurl… yes checking for QDBM support… no checking for GDBM support… no checking for NDBM support… no configure: error: DBA: Could not find necessary header file(s).

解决方案:

yum -y install db4-devel

checking for fabsf… yes checking for floorf… yes configure: error: jpeglib.h not found.

解决方案:

yum -y install libjpeg-devel

checking for fabsf… yes checking for floorf… yes checking for jpeg_read_header in -ljpeg… yes configure: error: png.h not found.

解决方案:

yum -y install libpng-devel

checking for png_write_image in -lpng… yes If configure fails try –with-xpm-dir=

configure: error: freetype.h not found.

解决方案:

Reconfigure your PHP with the following option. --with-xpm-dir=/usr

checking for png_write_image in -lpng… yes configure: error: libXpm.(a|so) not found.

解决方案:

yum -y install libXpm-devel

checking for bind_textdomain_codeset in -lc… yes checking for GNU MP support… yes configure: error: Unable to locate gmp.h

解决方案:

yum -y install gmp-devel

checking for utf8_mime2text signature… new checking for U8T_DECOMPOSE… configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.

解决方案:

yum -y install libc-client-devel

checking for LDAP support… yes, shared checking for LDAP Cyrus SASL support… yes configure: error: Cannot find ldap.h

解决方案:

yum -y install openldap-devel

checking for mysql_set_character_set in -lmysqlclient… yes checking for mysql_stmt_next_result in -lmysqlclient… no checking for Oracle Database OCI8 support… no checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h' not found!

解决方案:

yum -y install unixODBC-devel

checking for PostgreSQL support for PDO… yes, shared checking for pg_config… not found configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path

解决方案:

yum -y install postgresql-devel

checking for sqlite 3 support for PDO… yes, shared checking for PDO includes… (cached) /usr/local/src/php-5.3.7/ext checking for sqlite3 files in default path… not found configure: error: Please reinstall the sqlite3 distribution

解决方案:

yum -y install sqlite-devel

checking for utsname.domainname… yes checking for PSPELL support… yes configure: error: Cannot find pspell

解决方案:

yum -y install aspell-devel

checking whether to enable UCD SNMP hack… yes checking for default_store.h… no

checking for kstat_read in -lkstat… no checking for snmp_parse_oid in -lsnmp… no checking for init_snmp in -lsnmp… no configure: error: SNMP sanity check failed. Please check config.log for more information.

解决方案:

yum -y install net-snmp-devel

checking whether to enable XMLWriter support… yes, shared checking for xml2-config path… (cached) /usr/bin/xml2-config checking whether libxml build works… (cached) yes checking for XSL support… yes, shared configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution

解决方案:

yum -y install libxslt-devel

checking for PCRE headers location… configure: error: Could not find pcre.h in /usr

解决方案:

yum -y install pcre-devel

configure: error: Cannot find MySQL header files under yes. Note that the MySQL client library is not bundled anymore!

解决方案:

yum -y install mysql-devel

checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h' not found!

解决方案:

yum -y install unixODBC-devel

checking for pg_config… not found configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path

解决方案:

yum -y install postgresql-devel

configure: error: Cannot find pspell

解决方案:

yum -y install pspell-devel

configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.

解决方案:

yum -y install net-snmp-devel

configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution

解决方案:

yum -y install libxslt-devel

make错误

zipconf

/usr/local/include/zip.h:59:21: fatal error: zipconf.h: No such file or dire

解决

cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h

配置错误

错误5

[root@VM_159_140_centos php-7.2.16]# service php-fpm start 
Starting php-fpm [22-Mar-2019 14:31:38] ERROR: failed to open configuration file '/usr/local/php/etc/php-fpm.conf': No such file or directory (2)

解决5

/usr/local/php/etc/php-fpm.conf路径错误,反正我觉得是对的,但是老报错。

[root@VM_159_140_centos php-7.2.16]#cp sapi/fpm/php-fpm.conf /usr/local/php/etc/php–fpm.conf

这是之前的命令,把最好复制一下,重新粘贴到/etc/init.d/php-fpm中

php_fpm_CONF=/usr/local/php/etc/php-fpm.conf

《php编译错误总结》
《php编译错误总结》

    原文作者:王志强
    原文地址: https://zhuanlan.zhihu.com/p/62145198
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞