configure: error: png.h not found

Fix the "configure: error: png.h not found" error while compiling PHP. Find out how to easily install the missing libraries on Debian, Ubuntu, Re...

While compiling PHP, we may run into several errors, mainly resulting from missing developer libraries; here's one of them:

configure: error: png.h not found.

To eliminate the above error, we install the following package:

  • Debian / Ubuntu : aptitude install libpng12-dev (32/64 bit)
  • RedHat / CentOS / Fedora : yum install libpng-devel.x86_64 (64 bit) / yum install libpng-devel (32 bit)