Installing a fresh system with Gentoo 1.1a emerging php gives: [...] checking for the location of libpng... yes checking for png_create_info_struct in -lpng... no configure: error: libpng not found! !!! ERROR: The ebuild did not complete successfully. !!! Function src_compile, Line 148, Exitcode 1 !!! bad ./configure !!! emerge aborting on /usr/portage/dev-lang/php/php-4.2.0.ebuild . (libpng is emerged and is there in /usr/lib/libpng*)
Bug 2708 had the solution for this posted in its comments ;) BEFORE: --with-png-dir=/usr/lib \ AFTER: --with-png-dir=/usr \
*** Bug 2842 has been marked as a duplicate of this bug. ***
This one just bit me on a mod_php-4.3.1 compile as well. It didn't happen with the 4.3.0* that was installed before... After changing the ebuild as suggested, it compiled fine.