I've found a bug in CentOS 4.x that, while previously addressed, does not seem to be directly addressed here as far as the nature of the bug is concerned.
If you are having a problem getting this function to work on CentOS 4.4 (may appear earlier) and are receiving this error:
Call to undefined function imagecreatefromjpeg()
This is because the installation *does* support JPG by default if you have libjpeg installed. However, the config script finds libjpeg in /usr/lib but it is never successfully added to the PHP build.
To fix this, you should recompile PHP and be absolutely sure to add '--with-jpeg-dir' to the config command. This should appear BEFORE the --with-gd option. Example:
'--with-jpeg-dir' '--with-gd'
If you don't put it before --with-gd, the option is completely ignored.
As always, be sure to do a 'make clean' before a 'make install'. I made the mistake of forgetting to check and wasted 30 minutes trying to resolve this problem simply because I forgot to clean up after myself previously.