How to install GD2 Library ?

Hello,
does anyone know a tutorial to install the gd2 library on leopard server?

the tutorial from http://osx.topicdesk.com/ is not working properly.

Is it necessary to recompile php 5.2.4 which is shipped with leo server?

many questions here

chico

Various, Mac OS X (10.5)

Posted on Nov 6, 2007 8:12 AM

Reply
37 replies

Nov 12, 2007 5:38 AM in response to pterobyte

So I could use MAMP or something like that, or get the sources for the tools I need from Darwin Sources, then compile. If I go the compilation route, are there complete instructions somewhere that you know of?

By the way, the write up on installing gd was very accurate, build was perfect (except for the fact that my version of php doesn't support shared libraries.

Nov 12, 2007 6:07 AM in response to Adam Wizon

You could use MAMP, but that would defeat using OS X Server in the first place and will cause many redundancies. Also I believe all packages, MAMP, Entropy, etc, are pretty much going through the same kind of Leopard compatibility testing. I doubt there are already other instructions around, but as I said I am working on it (with CLI support) 😉

Unless you need it yesterday, stay tuned....

Nov 12, 2007 12:47 PM in response to pterobyte

@pterobyte
Thanks for the quick response, I tried adding <pre>extension_dir = "./"</pre> and restarting but I am still getting the same error_log message: PHP Warning: PHP Startup: Unable to load dynamic library './gd.so' - (null) in Unknown on line 0.

I checked my phpinfo() and extension_dir Local Value is ./ and Master Value is ./

Any other suggestions?

Nov 12, 2007 1:29 PM in response to pterobyte

Cheers for the tip, I changed it to: <pre>extension=/SourceCache/php-5.2.4/ext/gd/modules/gd.so</pre> which seems to have done the trick as I am now getting all the GD details in my phpinfo()!

BTW where should the gd.so actually sit normally in Leopard? As it seems a bit messy leaving it in the SourceCache folder!

Thanks again!

Nov 12, 2007 3:27 PM in response to pterobyte

I was getting this as well:

dyld: NSLinkModule() error
dyld: Symbol not found: php_siggif
Referenced from: /usr/lib/php/extensions/no-debug-non-zts-20060613/gd.so
Expected in: flat namespace

So I decided to recompile PHP, which can be a pain, but Apple's done most of the work for us:

run php-i | grep configure

and you'll see the factory configure line they used. For me, the only changes I had to make were:

1. Mysql doesn't ship with Leopard, if you want mysql extensions, you probably have mysql installed already. Either omit the mysql and mysqli configure options, or point them toward your local mysql install root. For me (msyql binary distribution), it was /usr/local/mysql
2. Mysql build is slightly horked, you have to make a directory in MYSQLROOT/lib/mysql and then symlink (or copy) all the files from MYSQLROOT/lib into that directory.
3. For some reason, php's cli was installed as /usr/bin/php.dSYM. After install, I just mv it to the correct name: /usr/bin/php

So to build php:

1. So, per pterobyte's HOWTO, download the php source, extract it, and cd to the src root.
2. copy the configure line from run php-i | grep configure, making (or omitting) the mysql extension options above
3. Add the configure options from pterobyte's GD HOWTO: '--with-jpeg-dir=/usr/local/lib/' '--with-png-dir=/usr/X11R6' '--with-freetype-dir=/usr/X11R6' '--with-xpm-dir=/usr/X11R6'
4. Tell it to build gd by adding this to the configure line: --with-gd
5. after configure is done: make
6. After make is done: sudo make install
7. Rename the cli, if you have the problem I did with it getting an odd name

Nov 13, 2007 3:58 AM in response to jeffiel

Since this is the Leopard Server Forum and not the client forum, a few clarifications to avoid confusion and broken servers:

-jeffiel's method is fine for Client but not for Server
-Leopard Server DOES ship with MySQL installed, but without the MySQL client libraries
-The MySQL client libraries are available from Apple's Darwin Sources
-For Server you should use the MySQL client libraries provided by Apple
-On Server there is no need to build MySQL again, just copy the libraries and headers

Please continue any discussion inherent to Leopard Client in the Client forum. Inexperienced users risk confusion and a hosed server.

For Leopard Server there are basically 2 methods available:
1. Install just the dynamically loaded extension gd.so, see:
http://osx.topicdesk.com/content/view/135/62/

2. Install a full build of GD and recompile PHP to integrate it, see:
http://osx.topicdesk.com/content/view/133/62/
http://osx.topicdesk.com/content/view/136/62/

Both methods work. Method number 1 gives you less flexibility and will not work with CLI PHP.

Nov 17, 2007 4:02 AM in response to Chico11mbit

I have a problem that, I think, started after that I installed GD2 and upgraded PHP 4.4.7. *Important to say is that I'm talking about a Server 10.4.11 installation and not Leopard*. I couldn't find a topic about this in the Tiger server forum so I continued this discussion instead.

The problem: I installed GD2 and upgraded the PHP (the way pterobyte described)and GD2 works fine, no problems. But ... *since then the server seems to have problems with timeouts*, they occure randomly but I suspect that it has to do with the php upgrade (does it write to the httpd.conf file as well?). Anyhow, I would be greatful to anyone who can help me.

I run Joomla 1.0.13 with OS X 10.4.11 and the only things I have done since the clean install is the GD2 installation and the PHP upgrade. I have also implemented Gzip support but that was after the problems started.

You can find my site at http://217.73.102.137 (under development).

Message was edited by: Campus Varberg

Nov 17, 2007 4:05 AM in response to pterobyte

I have a problem that, I think, started after that I installed GD2 and upgraded PHP 4.4.7. Important to say is that I'm talking about a Server 10.4.11 installation and not Leopard. I couldn't find a topic about this in the Tiger server forum so I continued this discussion instead.

The problem: I installed GD2 and upgraded the PHP (the way pterobyte described)and GD2 works fine, no problems. But ... since then the server seems to have problems with timeouts, they occure randomly but I suspect that it has to do with the php upgrade (does it write to the httpd.conf file as well?). Anyhow, I would be greatful to anyone who can help me.

I run Joomla 1.0.13 with OS X 10.4.11 and the only things I have done since the clean install is the GD2 installation and the PHP upgrade. I have also implemented Gzip support but that was after the problems started.

You can find my site at http://217.73.102.137 (under development).

Nov 17, 2007 5:09 AM in response to Campus Varberg

If you had permanent issues, it could (maybe, but unlikely) be attributed to your new PHP build. Random time-outs probably have other causes.

Could be connectivity issues or even something completely unrelated to the web server. Check your logs for clues. Also, while you experience these time-outs, how are the other services on your server behaving.

If you need more help, please use an existing 10.4.x thread or create a new one. As far as building PHP, Tiger and Leopard have some big differences. Add to that the 64-bit flavours and the confusion is mounting 😉

A broad selection of 10.4.x related threads can be found here:
http://discussions.apple.com/search.jspa?objID=f720&search=Go&q=GD

Alex

Nov 20, 2007 1:15 AM in response to Chico11mbit

Hi everyone,

I have a big problem with my php 5.2.5 when i try to compile it with GD library...actually i have a problem even if i don't use the --with-gd option (./configure step). The steps i follow are :

1. ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --with-apxs2=/usr/sbin/apxs --with-ldap=/usr --with-kerberos=/usr --enable-cli --with-zlib-dir=/usr --enable-trans-sid --with-xml --enable-exif --enable-ftp --enable-mbstring --enable-mbregex --enable-dbx --enable-sockets --with-iodbc=/usr --with-curl=/usr --with-config-file-path=/etc --sysconfdir=/private/etc --with-mysql-sock=/var/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql --with-openssl --with-xmlrpc --with-xsl=/usr --without-pear --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/X11R6 --with-gd=/usr/local

2. make

3. sudo make insall

After this, i can't launch my php server correctly...and when i try a 'php-config --php-binary' it shows me [/usr/bin/php.dSYM] instead of [/usr/bin/php]...How can i modify that 😟 ?

Thanks

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to install GD2 Library ?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.