

At least for me, I mean. GD library is not installed by default with the Mac OS X 10.5.x Leopard Server and if you’re still reading, maybe you want it too.
Needing to provide several websites with the ability of creating images dynamically, I tried to install the open source code known as GD library on my Mac OS X 10.5.8 Leopard Server, following the instructions at Entropy – PHP, venerable helpful web site for Mac SO X users, maintained by Marc Liyanage, and found myself with an acting server software: Although my server is setup on Advanced Mode, when I uncheck the PHP5 module in Server Admin → Web → Settings → Modules tab, it gets back to checked a few seconds after hitting the Save button.
I, too, was puzzled by the behavior of my otherwise amazing server software when trying to deactivate Mac OS X Leopard Server’s Apache PHP module, so you’re not alone. As many, I was hit by that curious server behavior.
Solution? Just comment out the current PHP5 installation in your server, and proceed with Marc Liyanage tremendous PHP Apache Module package, which contains the GD Library you need, and instructions.
I decided to take this approach based on my findings on Internet. Here they are:
1.- After stopping the Web service in Server Admin, locate the file httpd.conf and open it with you favorite text editor.
In my installation is in /private/etc/apache2/httpd.conf.
2.- Open and find the next line:
LoadModule php5_module libexec/apache2/libphp5.so
3.- Comment that line out (it deactivate the module) by writing a number sign # at the beginning of the line, like this:
#LoadModule php5_module libexec/apache2/libphp5.so
4.- Save the file. Start Web service in Server Admin.
By now PHP service should have stopped running on your server, which in turns disables every php-based file and function served by your server (if you’re following this, of course,) so one have to take the necessary precautions.
5.- Run the Entropy PHP 5.3.0-3.pkg. ← (link to page, download from there.)
This package will install and activate the new PHP module for your server, containing the desired GD library, along with other enhancements provided by the community that builds the PHP distributions. Marc explains it saying that “This is a PHP module for the Apache web server included in Mac OS X. PHP is a server-side, cross-platform, HTML embedded scripting language.”
This approach was successful in my installation of Mac OS X 10.5.8 Leopard Server. Allowed me to deactivate the running PHP5 module, it didn’t move the original PHP5 files provided by the server installer, and allowed me to run Marc’s great PHP Apache Module package, Mac OS X-type installer.
Caveat: Hope you find this info useful, but be careful with what you do to your server. I do this myself because I like it and have practiced for years, but it may not work for you and I by no means suggest you do this. Feel free to ask for details using the comments below.
Final note: The easiest way I’ve found to get the GD library functionality on my Leopard servers is by installing the complete PHP 5.3.0 package from http://www.entropy.ch/software/macosx/php/. Marc Liyanage precompiled this Mac OS X package to use it on Mac clients and Mac servers, and offers easy instructions there.
Tags: Mac OS X Server, Web Development

Update to this entry:
Today, upon restarting my server for the first time since I wrote this note (some 38 days running flawlessly), I found out that the new PHP Module (along with the GD Library) installed using this procedure was not working.
After a few minutes looking for a clue a found that the httpd.conf file was rewritten by the server, activating the old PHP original module!
I just turned of the Web service, opened httpd.conf, commented out the line as explained above, and everything was working again.
Ok, testing…
such a tester I am…