SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard Mincer's Avatar
    Join Date
    Mar 2001
    Location
    London | UK
    Posts
    1,140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How do I compile php with GD and freetype?

    As title really...

    How do I compile php with GD and freetype support? I've got the source for php 4.2.3, gd 1.8.4 and freetype 2.1.2.

    I have no idea what files I'm supposed to make first, or what config files to edit. *shrug*

    Thanks,

    Matt.

  2. #2
    FreeBSD The Power to Serve silver trophy pippo's Avatar
    Join Date
    Jul 2001
    Location
    Italy
    Posts
    4,514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A bit late but yesterday I tried to compile php with gd on my freebsd 4.4 machine.
    GD requires zlib, jpeg, png libraries installed.

    apache 1.3.26
    from /usr/local/src/apache
    ./configure --enable-shared=max --enable-module=most
    make && make install

    zlib-1.1.4
    from /usr/local/src/zlib
    ./configure --shared
    make && make install

    jpeg-6b
    from /usr/local/src/jpeg
    ./configure --enable-shared --enable-static
    make
    make test
    make install

    libpng-1.2.5
    from /usr/local/src/libpng
    cp scripts/makefile.freebsd makefile
    make test
    make install

    Note, it's important to say that libpng search for ../zlib

    gd-2.0.1
    from /usr/local/src/gd
    Edit Makefile and make this changes:
    1) I removed -DHAVE_LIBFREETYPE from CFLAGS
    but I think you don't have to because you want them
    2) I removed -lfreetype but I think you don't have to
    3) Changed INSTALL_LIB as /usr/local/lib
    4) Changed INSTALL_INCLUDE as /usr/local/include

    make install

    Note, I think that you have to install freetype before gd.
    But I didn't have to time to do it, so my changes to Makefile was necessary.

    php4.2.3
    ./configure
    etc etc
    --with-jpeg-dir=/usr/local
    --with-png-dir=/usr/local
    --with-zlib-dir/usr/local
    --with-gd=/usr/local

    make && make install


    I run phpinfo from a file and verified it, it worked.
    As you see I didn't install freetype, while you require them, but that's only because I didn't have time.... yesterday!
    My aim is to install pdflib too...

    Hope it helps.



    pippo

    p.s.
    I downloaded the various .tar.gz files into /usr/local/src.
    Then I extracted them with tar -xzvf.
    Then I modified the directory name from /usr/local/src/zlib-1.1.4 to /usr/local/src/zlib.
    This modification was necessary because libpng searches for ../zlib so I decided to do that for all the others directory as renaming /usr/local/src/apache-1.3.26 to /usr/local/src/apache after having extracted the tar files.

    p.s.2
    I did these steps on my notebook, my aim is to build the php module that I will upload to my remote semi-dedicated server.
    Last edited by pippo; Oct 6, 2002 at 23:42.
    Mr Andrea
    Former Hosting Team Advisor
    Former Advisor of '03

  3. #3
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Which OS / which linux distro? The only reason I ask is you should check if the GD library is installed from RPM before you go compliling from source - it probably is, along with zlib, jpeg and libpng. freetype might be. I actually did just this the other day on a new RedHat system. Just make sure you read the README and INSTALL files in each of the source directories.

    To query if a package exists

    rpm -q packagename

    If you are not sure of the exact package name then

    rpm -qa | grep expression


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •