I am trying to setup GD with the default PHP build that comes preinstalled on Leopard, but I am unable to get it work correctly.
So far I have followed these
instructions to get PHP5 working with with Apache2, this works fine and I am able to setup multiple virtual hosts for each of my websites and I have also downloaded and installed MySQL 5.0.45 which is now working fine with PHP the only problem is trying to get the extensions working.
I then tried following:
Add the GD Extension to PHP5 on OS X Server 10.5.x guide to install GD2, which all seemed to work in the terminal, but after I restarted Apache and reloaded my phpinfo() there is still no mention of GD.
Any ideas why it isn't working (PS I have installed Xcode and X11SDK, from the Leopard DVD)
Heres my terminal log:
<pre>Last login: Sun Nov 11 18:59:13 on ttys000
Sebs-Mac-Mini:~ Seb$ cd /SourceCache/jpeg-6b
Sebs-Mac-Mini:jpeg-6b Seb$ sudo cp /usr/share/libtool/config.sub .
Password:
Sebs-Mac-Mini:jpeg-6b Seb$ sudo cp /usr/share/libtool/config.guess .
Sebs-Mac-Mini:jpeg-6b Seb$ sudo ./configure --enable-shared
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking how to run the C preprocessor... gcc -E
checking for function prototypes... yes
checking for stddef.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for size_t... yes
checking for type unsigned char... yes
checking for type unsigned short... yes
checking for type void... yes
checking for working const... yes
checking for inline...
_inline_
checking for broken incomplete types... ok
checking for short external names... ok
checking to see if char is signed... yes
checking to see if right shift is signed... yes
checking to see if fopen accepts b spec... yes
checking for a BSD compatible install... /usr/bin/install -c
checking for ranlib... ranlib
checking host system type... i686-apple-darwin9.0.0
checking for ranlib... ranlib
checking for gcc... gcc
checking whether we are using GNU C... yes
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... none
checking whether ln -s works... yes
checking for ld used by GCC... /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) is GNU ld... no
checking whether the linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared libraries... no
checking for BSD-compatible nm... /usr/bin/nm -p
checking command to parse /usr/bin/nm -p output... no
checking how to hardcode library paths into programs... unsupported
checking for /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld option to reload object files... -r
checking dynamic linker characteristics... no
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for objdir... .libs
creating libtool
checking libjpeg version number... 62
creating ./config.status
creating Makefile
creating jconfig.h
jconfig.h is unchanged
Sebs-Mac-Mini:jpeg-6b Seb$ sudo make
make: Nothing to be done for `all'.
Sebs-Mac-Mini:jpeg-6b Seb$ mkdir -p /usr/local/include
Sebs-Mac-Mini:jpeg-6b Seb$ mkdir -p /usr/local/bin
Sebs-Mac-Mini:jpeg-6b Seb$ mkdir -p /usr/local/lib
Sebs-Mac-Mini:jpeg-6b Seb$ mkdir -p /usr/local/man/man1
Sebs-Mac-Mini:jpeg-6b Seb$ sudo make install
/usr/bin/install -c -m 644 jconfig.h /usr/local/include/jconfig.h
/usr/bin/install -c -m 644 ./jpeglib.h /usr/local/include/jpeglib.h
/usr/bin/install -c -m 644 ./jmorecfg.h /usr/local/include/jmorecfg.h
/usr/bin/install -c -m 644 ./jerror.h /usr/local/include/jerror.h
./libtool --mode=install /usr/bin/install -c libjpeg.la /usr/local/lib/libjpeg.la
/usr/bin/install -c libjpeg.la /usr/local/lib/libjpeg.la
/usr/bin/install -c .libs/libjpeg.a /usr/local/lib/libjpeg.a
ranlib /usr/local/lib/libjpeg.a
chmod 644 /usr/local/lib/libjpeg.a
------------------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
To link against installed libraries in a given directory, LIBDIR,
you must use the `-LLIBDIR' flag during linking.
You will also need to do one of the following:
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
------------------------------------------------------------------------------
./libtool --mode=install /usr/bin/install -c cjpeg /usr/local/bin/cjpeg
/usr/bin/install -c cjpeg /usr/local/bin/cjpeg
./libtool --mode=install /usr/bin/install -c djpeg /usr/local/bin/djpeg
/usr/bin/install -c djpeg /usr/local/bin/djpeg
./libtool --mode=install /usr/bin/install -c jpegtran /usr/local/bin/jpegtran
/usr/bin/install -c jpegtran /usr/local/bin/jpegtran
./libtool --mode=install /usr/bin/install -c rdjpgcom /usr/local/bin/rdjpgcom
/usr/bin/install -c rdjpgcom /usr/local/bin/rdjpgcom
./libtool --mode=install /usr/bin/install -c wrjpgcom /usr/local/bin/wrjpgcom
/usr/bin/install -c wrjpgcom /usr/local/bin/wrjpgcom
/usr/bin/install -c -m 644 ./cjpeg.1 /usr/local/man/man1/cjpeg.1
/usr/bin/install -c -m 644 ./djpeg.1 /usr/local/man/man1/djpeg.1
/usr/bin/install -c -m 644 ./jpegtran.1 /usr/local/man/man1/jpegtran.1
/usr/bin/install -c -m 644 ./rdjpgcom.1 /usr/local/man/man1/rdjpgcom.1
/usr/bin/install -c -m 644 ./wrjpgcom.1 /usr/local/man/man1/wrjpgcom.1
Sebs-Mac-Mini:jpeg-6b Seb$ cd /SourceCache/php-5.2.4/ext/gd
Sebs-Mac-Mini:gd Seb$ sudo phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
Sebs-Mac-Mini:gd Seb$ sudo ./configure --with-zlib-dir=/usr --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/X11R6 --with-freetype-dir=/usr/X11R6 --with-xpm-dir=/usr/X11R6
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc and cc understand -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-apple-darwin9.0.0
checking host system type... i686-apple-darwin9.0.0
checking target system type... i686-apple-darwin9.0.0
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib/php/extensions/no-debug-non-zts-20060613
checking for PHP installed headers prefix... /usr/include/php
checking for re2c... no
configure: WARNING: You will need re2c 0.12.0 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for GD support... yes, shared
checking for the location of libjpeg... /usr/local/lib
checking for the location of libpng... /usr/X11R6
checking for the location of libz... /usr
checking for the location of libXpm... /usr/X11R6
checking for FreeType 1.x support... no
checking for FreeType 2... /usr/X11R6
checking for T1lib support... no
checking whether to enable truetype string function in GD... no
checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... yes
checking for floorf... yes
checking for jpeg
readheader in -ljpeg... yes
checking for png
writeimage in -lpng... yes
checking for XpmFreeXpmImage in -lXpm... yes
checking for FT
NewFace in -lfreetype... yes
checking for ld used by gcc... /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) is GNU ld... no
checking for /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -p
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm -p output from gcc object... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
checking if gcc static flag works... rm: conftest.dSYM: is a directory
yes
checking if gcc supports -fno-rtti -fno-exceptions... rm: conftest.dSYM: is a directory
no
checking for gcc option to produce PIC... -fno-common
checking if gcc PIC flag -fno-common works... rm: conftest.dSYM: is a directory
yes
checking if gcc supports -c -o file.o... rm: conftest.dSYM: is a directory
yes
checking whether the gcc linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin9.0.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
Sebs-Mac-Mini:gd Seb$ sudo make
/bin/sh /SourceCache/php-5.2.4/ext/gd/libtool --mode=install cp ./gd.la /SourceCache/php-5.2.4/ext/gd/modules
cp ./.libs/gd.so /SourceCache/php-5.2.4/ext/gd/modules/gd.so
cp ./.libs/gd.lai /SourceCache/php-5.2.4/ext/gd/modules/gd.la
----------------------------------------------------------------------
Libraries have been installed in:
/SourceCache/php-5.2.4/ext/gd/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `DYLD
LIBRARYPATH' environment variable
during execution
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
Sebs-Mac-Mini:gd Seb$ sudo make install
Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20060613/
Installing header files: /usr/include/php/
Sebs-Mac-Mini:gd Seb$</pre>