Compile PHP 5.1 with JPEG support on Debian

Ok, here’s my configure command:


I ran into errors trying to run the function imagecreatefromjpeg and imagesx and imagesy. And the system could not find the jpeg libs. On Debian Sarge, you need to run an apt-get install libjpeg62-dev. Also, I ran configure with just the –with-jpeg switch, and it didn’t work. So, I had to also include the –with-jpeg-dir=/path/to/lib. On Debian is was in /usr/lib. After that, it all worked out.

It’s worth noting, you must have libpng, libjpeg, and GD installed as well.  If I remember, GD was already on Debian, or maybe it was in PHP, not sure about that, but I know it must installed.