1 2 Previous Next 29 Replies Latest reply: Oct 14, 2012 3:03 PM by etresoft Go to original post
  • 15. Re: Help recompiling gdlib
    etresoft Level 7 Level 7 (24,270 points)
    First of all - a question. What have you already installed? The only gd I have is the bundled one from PHP. I don't have any gdlib-config at all. The instructions below assume there isn't any standalone gd installed on your system.

    OK. Here is what you do:

    1) Download the source for libgd from: https://bitbucket.org/pierrejoye/gd-libgd/overview
    2) Extract the tar ball
    3) Edit the file src/configure.ac and remove the 4 lines that start with 'AM_ICONV'
    4) Go into the src directory and run: "ln -s ../config config" and "ln -s ../test test"
    5) Now (still in src) run "sh bootstrap.sh"
    6) Now (still in src) run "autoreconf -fvi"
    (Hopefully you have had no errors by this point)
    7) Now (still in src) run "./configure"

    On my machine, I am running 10.6.7 with Xcode3 and Xcode4 installed. In the past, I have installed a fair number of funky Perl modules. After running "./configure", my system reports:

    Support for PNG library: yes
    Support for JPEG library: yes
    Support for Freetype 2.x library: yes
    Support for Fontconfig library: yes
    Support for Xpm library: yes
    Support for pthreads: yes

    If yours doesn't say the same thing, you may have to go back and install some prerequisites.

    8) Run "make"
    9) Run "sudo make install"

    At this point, you have a standalone libgd installed in /usr/local. If you build all of your Perl modules, they should find that automatically. I don't know what GD they found before.
  • 16. Re: Help recompiling gdlib
    Linc Davis Level 10 Level 10 (118,250 points)
    The thing is front-ended as a web app on the developer's site. There's no need for him to install it at all, unless he's dealing with some super-secret dataset.
  • 17. Re: Help recompiling gdlib
    etresoft Level 7 Level 7 (24,270 points)
    Linc Davis wrote:
    The thing is front-ended as a web app on the developer's site. There's no need for him to install it at all, unless he's dealing with some super-secret dataset.


    It seems to be something the developers expect users would want to download.

    You had the right idea by asking about where GD came from. I was a bit confused before, but I get it now.
  • 18. Re: Help recompiling gdlib
    Linc Davis Level 10 Level 10 (118,250 points)
    +It seems to be something the developers expect users would want to download.+

    Or use online.
  • 19. Re: Help recompiling gdlib
    garberal Level 1 Level 1 (0 points)
    etresoft wrote:
    First of all - a question. What have you already installed? The only gd I have is the bundled one from PHP. I don't have any gdlib-config at all. The instructions below assume there isn't any standalone gd installed on your system.

    OK. Here is what you do:

    1) Download the source for libgd from: https://bitbucket.org/pierrejoye/gd-libgd/overview
    2) Extract the tar ball
    3) Edit the file src/configure.ac and remove the 4 lines that start with 'AM_ICONV'
    4) Go into the src directory and run: "ln -s ../config config" and "ln -s ../test test"
    5) Now (still in src) run "sh bootstrap.sh"
    6) Now (still in src) run "autoreconf -fvi"
    (Hopefully you have had no errors by this point)
    7) Now (still in src) run "./configure"

    On my machine, I am running 10.6.7 with Xcode3 and Xcode4 installed. In the past, I have installed a fair number of funky Perl modules. After running "./configure", my system reports:

    Support for PNG library: yes
    Support for JPEG library: yes
    Support for Freetype 2.x library: yes
    Support for Fontconfig library: yes
    Support for Xpm library: yes
    Support for pthreads: yes

    If yours doesn't say the same thing, you may have to go back and install some prerequisites.

    8) Run "make"
    9) Run "sudo make install"

    At this point, you have a standalone libgd installed in /usr/local. If you build all of your Perl modules, they should find that automatically. I don't know what GD they found before.



    Amazing, thank you so much for this. You are a man among men, I never would've figured this out on my own.

    Linc: at this point, getting GD working right had become something I needed to see through to put my mind at rest.

    Thanks for everything, I really appreciate it.

    - Andrew
  • 20. Re: Help recompiling gdlib
    Morris Zwick Level 1 Level 1 (0 points)

    First, thanks for the post as I think it has gotten me remarkably close to the finish line.

     

    I am trying to get the GD Freetype Library working for a webstore application. I ran through the install posted by etresoft and everything compiled and configured fine. Start and stopped Apache. Still no joy.

     

    In my SLS configuration from Server Admin, I am running the built-in PHP with one extension (prior to getting this working) of the mcrypt libraries. The built-in PHP has the JPEG, PNG and GIF libraries installed but not Freetype.

     

    Do I need to add an extension line in the php.ini file to pick up the locally built GD library presented above?

     

    Thanks!

  • 21. Re: Help recompiling gdlib
    etresoft Level 7 Level 7 (24,270 points)

    Morris Zwick wrote:

     

    Do I need to add an extension line in the php.ini file to pick up the locally built GD library presented above?

    Perhaps. Here is my standard link to hacking up PHP: http://michaelgracie.com/2011/07/21/plugging-mcrypt-into-php-on-mac-os-x-lion-10 -7/

  • 22. Re: Help recompiling gdlib
    Morris Zwick Level 1 Level 1 (0 points)

    I actually used your guidance to get mcrypt working (thanks!) before, although I am running 10.6.8 server rather than Lion (the whole Lion upgrade thing freaks me out with the number of services on my server dependent on MySQL).

     

    For the GD library, I executed what you posted above. I then added "extension = gd.so" to php.ini but no dice. Do I have to do some sort of compile on a portion of PHP also?

     

    Sorry to be dense here, but the GD libraries are a bit of an enigma...

  • 23. Re: Help recompiling gdlib
    etresoft Level 7 Level 7 (24,270 points)

    Morris Zwick wrote:

     

    I actually used your guidance to get mcrypt working (thanks!) before, although I am running 10.6.8 server rather than Lion (the whole Lion upgrade thing freaks me out with the number of services on my server dependent on MySQL).

    It shouldn't make a difference. You just need to make sure to download the source to PHP that matches whatever happens to be running on your version of the OS. While Lion Server no longer includes MySQL, you can download and install it on your own.

     

    For the GD library, I executed what you posted above. I then added "extension = gd.so" to php.ini but no dice. Do I have to do some sort of compile on a portion of PHP also?

     

    Sorry to be dense here, but the GD libraries are a bit of an enigma...

     

    Same here. Are you making sure to restart the Apache server? Does GD show up in an info.php page?

  • 24. Re: Help recompiling gdlib
    Morris Zwick Level 1 Level 1 (0 points)

    "It shouldn't make a difference. You just need to make sure to download the source to PHP that matches whatever happens to be running on your version of the OS. While Lion Server no longer includes MySQL, you can download and install it on your own."

     

    True, but I would prefer not having to reinstall and restore my MySQL DBs from scratch. I get the impression that a Lion install will wipe them out.

     

    Anyway... back at the ranch:

     

     

    This is what info.php returns for GD:

     

    gd

    GD Supportenabled
    GD Versionbundled (2.0.34 compatible)
    GIF Read Supportenabled
    GIF Create Supportenabled
    JPEG Supportenabled
    libJPEG Version8
    PNG Supportenabled
    libPNG Version1.5.4
    WBMP Supportenabled
    XBM Supportenabled

     

    DirectiveLocal ValueMaster Value
    gd.jpeg_ignore_warning00
  • 25. Re: Help recompiling gdlib
    etresoft Level 7 Level 7 (24,270 points)

    You may need to rebuild PHP completely. It is easy enough to add a module that PHP doesn't have. But if PHP already has it built-in, it may never look for a module.

  • 26. Re: Help recompiling gdlib
    bwparks Level 1 Level 1 (0 points)

    I tried this fix and made it to bootstrap with the following error....

     

    bootstrap.sh: line 25: aclocal: command not found

    Failed

     

     

    Not sure how to fix from here..

  • 27. Re: Help recompiling gdlib
    etresoft Level 7 Level 7 (24,270 points)

    There is no "fix" here. This is a horribly complex issue and thread. I strongly suggest you start your own thread specific to your exact problem. Chiming in a year later with a random error is a non-starter.

  • 28. Re: Help recompiling gdlib
    g01dfish Level 1 Level 1 (0 points)

    I have the same issue as bwparks. Does anyone know why this issue has arisen?

  • 29. Re: Help recompiling gdlib
    etresoft Level 7 Level 7 (24,270 points)

    g01dfish wrote:

     

    I have the same issue as bwparks. Does anyone know why this issue has arisen?

    What issue? The junky open-source software is unsupported on Macs? I think that issue arrived circa 1984.

     

    I suggest you see what other people have tried and then post a new question here if it still doesn't work.

1 2 Previous Next