--- ext/gd/config.m4.orig.port	Thu May 12 09:19:37 2011
+++ ext/gd/config.m4	Fri Jan 13 18:01:58 2012
@@ -97,7 +97,7 @@ AC_DEFUN([PHP_GD_PNG],[
   if test "$PHP_PNG_DIR" != "no"; then
 
     for i in $PHP_PNG_DIR /usr/local /usr; do
-      test -f $i/include/png.h && GD_PNG_DIR=$i && break
+      test -f $i/include/libpng/png.h && GD_PNG_DIR=$i && break
     done
 
     if test -z "$GD_PNG_DIR"; then
