When building from the php SRPM, during the compile of the embedded imap-4.5 package, mail.c does an #include <linux/limits.h>, which will fail if the kernel-source RPM isn't installed. The work-around is to install the kernel-source RPM. The permanent fix is probably to include just plain <limits.h>, but I didn't try this or look at the source. Incidentally, why does the php SRPM bundle and build its own imap-4.5 package? It should just require the imap-4.5 RPM that comes with RedHat, as a build prerequisite.
the next release of php doesn't include imap, instead it accesses the static c-client library provided from the new imap-devel package. No library was provided before, so the code was included in the RPM directly.