20+ common PHP compilation errors and fix – Unix

Compiling PHP is not an easy process by comparing with the installation of PHP using package managers like Yum or Apt-get.

The main advantage of compiling PHP from its source code is the customisation. That means you can customise your own PHP with custom modules.

There’re a lot of dependencies required for the compilation of PHP from its source code. By using package manager the dependencies are automatically detected and install with the corresponding package.

Here I am listing some common PHP compilation error and fix. This will helpful for compiling PHP on your server.

Php compilation on server means the building and installation of PHP from its source.

There’re chances to get a lot of error while compiling the PHP. See some common PHP compilation errors and their fixes.

ERROR I :

checking for BZip2 support… yes
checking for BZip2 in default path… not found
configure: error: Please reinstall the BZip2 distribution

Solution:

yum install bzip2-devel

ERROR II :

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

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).

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.

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.

Thank you so much, you saved me from lots of trouble I’m having while I’m trying to compile PHP from source on Debian, it seems that your tutorial was meant for CentOS users. But I was wondering if I could share with you the problems I had with your error VI and how I found the solution (I got stuck for many many hours trying to get by this one only, lots of libXpm.so|a not found or freetype.h not found while playing with –with-xpm-dir and –with-vpx-dir options). Due to the fact that I’m compiling on Debian the name of the packages change a little bit. Maybe you could add those solutions onto your tutorial. (2 symbolic links created and two packages installed made me get by this).