Các lỗi thường gặp trong quá trình biên dịch PHP

Bài viết này DGsolution đề cập đến một số lỗi PHP thường gặp nhất trong quá trình xử lý PHP trên máy chủ của bạn. DGsolution sẽ ví dụ trên hệ điều hành CentOS 7 nhé. Vì trong quá trình quản lý và sử dụng VPS Linux thì các thao tác đối với PHP là khá nhạy cảm. Hay phát sinh sự cố trong quá trình thực thi các dịch vụ trên máy chủ.

Lỗi 1 và cách fix

checking for BZip2 support… yeschecking for BZip2 in default path… not foundconfigure: error: Please reinstall the BZip2 distribution

Fix:

yum install bzip2devel

Lỗi 2 và cách fix

checking for cURL support… yeschecking if we should use cURL for url streams… nochecking for cURL in default path… not foundconfigure: error: Please reinstall the libcurl distribution -easy.h should be in /include/curl/

Fix:

yum install curl-devel

Lỗi 3 và cách fix

checking for fabsf… yeschecking for floorf… yesconfigure: error: jpeglib.h not found.

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

Fix:

yum install libpng-devel

Lỗi 4 và cách fix

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

Fix:

yum install db4-devel

Lỗi 5 và cách fix

checking for png_write_image in -lpng… yesIf configure fails try –with-xpm-dir= configure: error: freetype.h not found.

Fix:

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

Lỗi 6 và cách fix

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

Fix:

yum install libXpm-devel

Lỗi 7 và cách fix

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

Fix:

yum install gmp-devel

Lỗi 8 và cách fix

checking for utf8_mime2text signature… newchecking 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.

Fix:

yum install libc-client-devel

Lỗi 9 và cách fix

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

Fix:

yum install openldap-devel

Lỗi 10 và cách fix

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

Fix:

yum install unixODBC-devel

Lỗi 11 và cách fix

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

Fix:

yum install postgresql-devel

Lỗi 12 và cách fix

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

Fix:

yum install sqlite-devel

Lỗi 13 và cách fix

checking for utsname.domainname… yeschecking for PSPELL support… yesconfigure: error: Cannot find pspell

Fix:

yum install aspell-devel

Lỗi 14 và cách fix

checking whether to enable UCD SNMP hack… yeschecking for default_store.h… no checking for kstat_read in -lkstat… nochecking for snmp_parse_oid in -lsnmp… nochecking for init_snmp in -lsnmp… noconfigure: error: SNMP sanity check failed. Please check config.log for more information.

Fix:

yum install net-snmp-devel

Lỗi 15 và cách fix

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

Fix:

yum install libxslt-devel

Lỗi 16 và cách fix

configure: error: xml2-config not found. Please check your libxml2 installation.

Fix:

yum install libxml2-devel

Lỗi 17 và cách fix

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

Fix:

yum install pcre-devel

Lỗi 18 và cách fix

libtool: link: cannot find the library /usr/lib/libidn.la’ or unhandled argument /usr/lib/libidn.la’make: *** [sapi/cgi/php-cgi] Error 1

Fix:

cd /usr/src/wget http://ftp.gnu.org/gnu/libidn/libidn-1.26.tar.gztar -zvxf libidn-1.26.tar.gzcd libidn-1.26./configuremakemake installln -s /usr/local/lib/libidn.la /usr/lib/libidn.la

Lỗi 19 và cách fix

libtool: link: `/usr/lib/libxml2.la’ is not a valid libtool archivemake: *** [ext/xsl/xsl.la] Error 1

Fix:

cd /usr/src/wget ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gztar -zvxf libxml2-2.7.3.tar.gzcd libxml2-2.7.3./configure –prefix=/usrmakemake install

Lỗi 20 và cách fix

configure: error: Your t1lib distribution is not installed correctly. Please reinstall it.

Fix:

yum install t1lib-devel.x86_64

Lỗi 21 và cách fix

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

Fix:

yum install libmcrypt-devel.x86_64

Lỗi 22 và cách fix

configure: error: Cannot find libtidy

Fix:

yum install libtidy libtidy-devel

 

Trả lời

Email của bạn sẽ không được hiển thị công khai.

0387 109 109
Chat Zalo