在Ubuntu系统中配置PHP时,可能会遇到一些常见错误。以下是一些典型的错误及其解决方法:
缺少必要的开发库:
configure: error: Please reinstall libcurl distribution -easy.h should be in /include/curl/
解决办法:sudo apt-get install libcurl4-gnutls-dev libcurl4-openssl-dev
缺少SASL支持:
configure: error: sasl.h found!
解决办法:sudo apt-get install libsasl2-dev
缺少NCurses支持:
configure: error: Pleasereinstall ncurses distribution
解决办法:sudo apt-get install libncurses5-dev
缺少libxml2支持:
configure: error: xml2-config found. Pleasecheck your libxml2 installation.
解决办法:sudo apt-get install libxml2-dev
缺少OpenSSL支持:
configure: error: Cannot find OpenSSL evp.h
解决办法:sudo apt-get install openssl6
缺少BZip2支持:
configure: error: Pleasereinstall BZip2 distribution
解决办法:sudo apt-get install bzip2
缺少libXpm支持:
configure: error: libXpm.(aso) not found.
解决办法:sudo apt-get install libXpm-dev
缺少libjpeg和libpng支持:
configure: error: libjpeg.(also).II
和 configure: error: libpng.(also).II
解决办法:sudo apt-get install libjpeg-dev libpng12-dev
缺少MySQL支持:
configure: error: Cannot find MySQL header files under /usr. Note MySQL client library bundled anymore!
解决办法:sudo apt-get install libmysql-dev
缺少GMP支持:
configure: error: Compile时缺少gmp.h文件
解决办法:sudo apt-get install libgmp-dev libgmp3-dev
缺少pspell支持:
configure: error: Cannot find pspell.
解决办法:sudo apt-get install libpspell-dev
缺少mcrypt支持:
configure: error: mcrypt.h found. Pleasereinstall libmcrypt.
解决办法:sudo apt-get install libmcrypt-dev mcrypt
缺少SNMP支持:
configure: error: snmp.h found. Check your SNMP installation.
解决办法:sudo apt-get install libsnmp-dev
缺少LDAP支持:
configure: error: Cannot find ldap.h
解决办法:sudo apt-get install libldap2-dev ldap-utils
缺少libxslt支持:
configure: error: xslt-config found. Pleasereinstall 1.1.0 distribution
解决办法:sudo apt-get install libxslt1-dev
缺少libevent支持:
configure: error: Could find libevent 1.4.11/usr/local/php
解决办法:安装libevent-1.4.11以上版本至/usr/local
,然后./configure --prefix=/usr/local
,在编译./configure
时添加--with-libevent-dir=/usr/local
缺少libpcre支持:
configure: error: Could not find pcre.h/usr
解决办法:sudo apt-get install libpcre3-dev
缺少db4支持:
configure: error: DBA: Could find necessary header file(s). checking db4 major version... configure: error: Header contains different version
解决办法:sudo apt-get install libdb4.8-dev
缺少freetype支持:
configure: error: freetype.h found.
解决办法:sudo apt-get install libfreetype6-dev
缺少PostgreSQL支持:
configure: error: Cannot find libpq-fe.h. Pleasespecify correct PostgreSQL installation path
解决办法:sudo apt-get install postgresql-server-dev-9.12
缺少t1lib支持:
configure: error: Your t1lib distribution is installed correctly. Please reinstall it.
解决办法:sudo apt-get install libt1-dev
缺少GD支持:
configure: error: Unable find gd.h anywhere under /usr
解决办法:sudo apt-get install libgd2-xpm-dev
缺少ODBC支持:
configure: error: ODBC header file /usr/include/sqlext.h found!
解决办法:sudo apt-get install unixodbc-dev
缺少FreeTDS支持:
configure: error: Directory /usr FreeTDS installation directory
解决办法:sudo apt-get install freetds-dev
缺少libtidy支持:
configure: error: Cannot find libtidy.
解决办法:sudo apt-get install libtidy-dev
PHP扩展配置错误:
configure: error: You've configured extension pdo_sqlite build statically, extension pdo, which you've configured build shared. You either need build pdo_sqlite shared bu
解决办法:确保在配置时统一静态和共享扩展的构建选项通过以上步骤,您应该能够解决大多数在Ubuntu系统中配置PHP时遇到的问题。如果问题仍然存在,请根据具体的错误信息进一步排查。