我以为缺省就有PNG支持呢。应该怎样编译进PNG呢?

解决方案 »

  1.   

    确定你的*nix已经装了libpng,重新编译PHP,加入下面参数
    --with-png-dir=[path to libpng]
    如果libpng时系统缺省安装path一般为/usr,如果自己安装一般为/usr/local
      

  2.   

    这些都做了。过程如下(有点长,麻烦您帮我看看):(Linux k=2.4.10)
    目录/usr/local/src
    [jpeg-6b]
    ./configure
    make
    make test
    make install[zlib]
    make test
    make install[freetype-2.0.8]
    ./configure --prefix=/usr/local
    make
    make install[libpng-1.0.10]
    cp scripts/makefile.linux makefile
    make test
    pngtest pngnow.png (passed)
    make install[gd-1.8.4]
    edit Makefile 
    ---uncomment follow lines:CFLAGS=-O -DHAVE_LIBXPM -DHAVE_LIBPNG -DHAVE_LIBJPEG \
            -DHAVE_LIBFREETYPE -DHAVE_LIBTTF
    LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm -lttf---comment follow lines:
    CFLAGS=-O -DHAVE_LIBPNG -DHAVE_LIBJPEG
    LIBS=-lgd -lpng -lz -lm---modify follow line:
    INCLUDEDIRS=-I. -I/usr/local/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include -I/usr/include/freetypemake
    make install[php-4.1.1]
    ./configure \
    --with-apache=/usr/local/src/apache_1.3.23 \
    --with-config-file-path=/cal/apache/conf \
    --with-enable-versioning \
    --with-mysql=/usr/local/mysql \
    --with-ftp \
    --with-gd=/usr/local \
    --with-enabled-bcmath=yes \
    --with-disable-debug \
    --enable-memory-limit=yes \
    --enable-track-vars \
    --with-zlib \
    --with-jpeg-dir=/usr/local/
    --with-png-dir=/usr/local/make
    make install[apache_1.3.23]
    ./configure --prefix=/usr/local/apache --enable-module=most --enable-shared=enable-module=ssl --enable-sh
    ared=ssl --activate-module=src/modules/php4/libphp4.a
    make
    make installphpinfo()中GD库的部分如下:
    GD Support enabled 
    GD Version 1.6.2 or higher 
    WBMP Support enabled 
    JPEG和PNG部分都不支持,但却支持WBMP不知道为什么。