I got PHP 5.2.5 compiled on my system with a new shiny Apache too. I started off with an old version of CURL so it didn't work. I then got the new version of CURL and it worked! I decided to get IMAP working by trying both the 2006 and the earlier versions, but neither work - the compilation stops due to a variable name conflict. I'm not sure if the 2007 release is stable, but I'll give it a shot.
Anyway, I'll probably just have to go without IMAP till someone decides to work on the source code and come up with a new release.