onfigure: error: Package requirements (libpng) were not met:
Package 'libpng', required by 'virtual:world', not found
PHP's ./configure uses pkg-config to locate libpng (for the GD extension). pkg-config couldn't find it, so configure aborted and the whole build died.
Root cause: libpng-devel was installed — but only the i686 (32-bit) package. A 32-bit -devel drops its pkg-config file at:
/usr/lib/pkgconfig/libpng.pc ← 32-bit path
But on a 64-bit box, pkg-config only searches:
/usr/lib64/pkgconfig : /usr/share/pkgconfig ← note: /usr/lib (32-bit) NOT included
So pkg-config --exists libpng returned false even though the package looked installed. (This is a CWP-on-AL9 quirk — some of its build-dep steps pull .i686 packages.)
The fix — install the x86_64 dev package so the .pc lands in the path pkg-config actually searches:
dnf -y --enablerepo=crb,epel install libpng-devel.x86_64 gd-devel postgresql-devel
Note: on AlmaLinux 9 the -devel repo is crb (CodeReady Builder), which replaced AL8's powertools. After this, /usr/lib64/pkgconfig/libpng.pc exists and pkg-config --exists libpng → OK (1.6.37), so the GD/libpng configure step passes and PHP compiles.