Web Hosting Talk







View Full Version : Installing GD on OS X...again


BostonGuru
11-17-2007, 09:37 PM
Maybe it is just because I don't know what I'm doing....but trying to install a script from command line in unix seems to be a pain. All the compilers, repositories, subscripts, seem to be a lot of work to install one script. Anyways, I am trying to install GD again on a mac for developmental purposes and once again I am having (different) difficulties.

I found a great tutorial for installing gd, and I was able to get gd to compile with libpng/jpeg, etc, and a file called gd.so was placed into the php extension folder.

I then went into the /etc folder and edited php.ini and php.ini.default and appended "extension=gd.so" which according to the tutorial was the last step. However if I try to open an info.php (after restarting apache), or just run php -i from the terminal, gd does not show up. None of its functions are recognized either. Am I missing a step?

shellpenguin
11-17-2007, 10:35 PM
Maybe it is just because I don't know what I'm doing....but trying to install a script from command line in unix seems to be a pain. All the compilers, repositories, subscripts, seem to be a lot of work to install one script. Anyways, I am trying to install GD again on a mac for developmental purposes and once again I am having (different) difficulties.

I found a great tutorial for installing gd, and I was able to get gd to compile with libpng/jpeg, etc, and a file called gd.so was placed into the php extension folder.

I then went into the /etc folder and edited php.ini and php.ini.default and appended "extension=gd.so" which according to the tutorial was the last step. However if I try to open an info.php (after restarting apache), or just run php -i from the terminal, gd does not show up. None of its functions are recognized either. Am I missing a step?

If you have already installed the support of jpeg and png files, go back to your gd source folder and

pushd gd-VERSION

sudo make install
sudo ranlib /usr/local/lib/libgd.a
popd

Did it help?

BostonGuru
11-17-2007, 10:44 PM
how can i find the gd version? For source I am using the ext/gd folder of the php 5.2.4 source.

shellpenguin
11-17-2007, 11:10 PM
does not matter with the version, just cd into it..

BostonGuru
11-18-2007, 03:29 PM
I ran those commands, but got an error with the third command.

sh-3.2# pushd gd
/sourceCache/php-5.2.4/ext/gd /sourceCache/php-5.2.4/ext
sh-3.2# make install
/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_LIBRARY_PATH' 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.
----------------------------------------------------------------------
Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20060613/
Installing header files: /usr/include/php/
sh-3.2# ranlib /usr/local/lib/libgd.a
ranlib: can't open file: /usr/local/lib/libgd.a (No such file or directory)

shellpenguin
11-18-2007, 07:23 PM
I ran those commands, but got an error with the third command.

sh-3.2# pushd gd
/sourceCache/php-5.2.4/ext/gd /sourceCache/php-5.2.4/ext
sh-3.2# make install
/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_LIBRARY_PATH' 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.
----------------------------------------------------------------------
Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20060613/
Installing header files: /usr/include/php/
sh-3.2# ranlib /usr/local/lib/libgd.a
ranlib: can't open file: /usr/local/lib/libgd.a (No such file or directory)


Hmm it means that first command did not run correctly! Could you just not the download the binaries off the GD site?