php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44778 libjpeg not found (easily)with --with-gd
Submitted: 2008-04-18 16:52 UTC Modified: 2008-04-19 20:14 UTC
From: mike at clove dot com Assigned:
Status: Not a bug Package: GD related
PHP Version: 5.2.5 OS: Mac OS X 10.4.11
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mike at clove dot com
New email:
PHP Version: OS:

 

 [2008-04-18 16:52 UTC] mike at clove dot com
Description:
------------
ext/gd/config.m4 contains code which looks for libjpeg.a and libjpeg.<dynamic suffix> in $PHP_JPEG_DIR/$PHP_LIBDIR, /usr/local/$PHP_LIBDIR and /usr/$PHP_LIBDIR. This fails to find libjpeg.<whatever> when libjpeg is loaded onto a mac using macports because it lives in /opt/local/lib.

Suggest adding, after line 75:
SUP_DIR=`dirname $PHP_JPEG_DIR`

and modifying line 76 to read:
  for i in $PHP_JPEG_DIR $SUP_DIR /usr/local /usr; do

Same holds for the libpng search and probably other things.

Actually, it would be nice if the script searched /usr/local and /usr libraries if --with-gd were set, rather than having to know that you have to set --with-jpeg-dir=...

If there is interest, I can hack the file




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-18 23:34 UTC] jani@php.net
This is why there are the configure options available for people to provide exotic locations for the libraries. And no, /opt is not any "standard" location for anything.
 [2008-04-19 19:59 UTC] mike at clove dot com
ext/gd/config.m4 is munged because it can't find /usr/local/lib/libjpeg.a on my machine - running Mac OS X 10.4.11.

I know it's there because I built and installed it myself.

the only way it finds libjpeg.a is by using --with-jpeg-dir=/usr/local.

this is a configuration bug which cost me about 4 days to find because I thought PHP built correctly. Didn't find it until drupal barfed on image uploads.

It ain't Bogs
 [2008-04-19 20:14 UTC] pajoye@php.net
Hi Mike,

To say in a different way:

It is not a bug. The JPEG support is optional. You have to use this option to configure PHP GD with jpeg support.

This is specially true for exotic locations like the ones the endless amount of weird places used by OS X.

by the way, bogus means "Not a bug"
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Dec 07 01:00:01 2025 UTC