Greetings,
I am a few steps ahead of you with the same install of php, gdlib, and jpeg6.
I had the same problem when I was installing the above onto a Sparc/Solaris 2.6 machine.
I found a message at Geocrawler that helped tons.
http://www.geocrawler.com/archives/3/5/2000/5/0/3811525/
but I can't seem to get there right now.
If it is urgent just reply to this message and I will try to recall my steps.
I finally got PHP to build with Jpeg support through gd but when I try to create a jpeg via php it says my build does not support jpeg...despite the fact that phpinfo reports it to be available.
-briand