Posted by gil on November 9, 2009
I have installed GD a few times before, and never cam across this problem, maybe I was just lucky. I installed ImageMagick, GD and JPEG on the machine, a FreeBSD 7.1-RC2 server running Apache 1.3.41 and PHP 5.2.11.
- /usr/ports/graphics/gd
- /usr/ports/graphics/ImageMagick
- /usr/ports/graphics/jpeg
That was easy, just “make install clean” and you’re in business..
Then, I proceeded to recompile PHP:
./configure –with-mysql –with-apxs=/usr/local/sbin/apxs –with-pcre-regex –enable-mbstring=en –with-zlib –with-gd –with-jpeg
Ah, problem.. “–with-jpeg” is not recognized. I don’t care about PNG support, since it is included in GD by default. After a bit of research, I find out that I need to add the path to the jpeg library:
./configure –with-mysql –with-apxs=/usr/local/sbin/apxs –with-pcre-regex –enable-mbstring=en –with-zlib –with-gd –with-jpeg-dir=/usr/lib
Now the output of phpinfo() shows my option, but scrolling down to the GD info box, I don’t see JPEG enabled there, crap! So, I try a few locations for the jpeg library, /usr, /usr/local, /usr/local/lib.. Same result. It should be /usr/lib.. Am I forgetting something? Well, yes, the problem has to be related to the path..
Then it hits me! I didn’t do a “make clean” before reconfiguring.. I try that, bingo! Jpeg enabled!
Good luck with your installation 

Related posts
Filed under: Computing
Leave a Reply