PHP 7.4.3 Configure Errors – libpng, libjpeg, freetype-config, recode not found

Updated on May 12, 2020

Question: I was trying to compile PHP 7.4.3 from the source with GD library support. Unfortunately, the configure script failed with the following errors:

If configure fails try --with-jpeg-dir=<DIR>
configure: error: libpng.(a|so) not found.

configure: error: libjpeg.(a|so) not found.

configure: error: freetype-config not found.

configure: error: recode not found

Solution:

To fix libpng not found error, you need to install libpng and libpng-devel packages. Similarly, install the rest of the packages as shown below.

yum install libpng
yum install libpng-devel
yum install libjpeg
yum install libjpeg-devel
yum install freetype
yum install freetype-devel
yum install recode
yum install recode-devel

Once the above-said packages are installed, the PHP configure script ran successfully. Also, read solutions for other errors while compiling PHP from source.

Was this article helpful?

Related Articles

Leave a Comment