Howto enable gd for PHP 5.3.28

Ryan Schmidt ryandesign at
Sun Feb 9 17:14:45 PST 2014

On Feb 9, 2014, at 18:22, Tim Johnson <tim at> wrote:

> * Ryan Schmidt <ryandesign at> [140209 13:05]:
>> On Feb 9, 2014, at 15:57, Tim Johnson <tim at> wrote:
>>> I'm running OSX 10.7
>>> Latest PHP is ver 5.3.28
>>> I do not see that gd is enabled for it.
>>> What is the method to do so?
>>> thanks
>> It depends on which php port you have installed. 
>> If you installed the php53 port, then install the php53-gd port. 
>> If you installed the php5 port, then install the php5-gd port, and consider switching to the newer php53* ports. 
>  Thank you. 
>  FYI linux experienced mac noob...
>  FYI python experienced php noob...
>  By running 
>  which -a php 
>  ## I see three php binaries
>  /opt/local/bin/php
>  /usr/bin/php
>  /usr/local/bin/php

The first is provided by MacPorts.

The second is provided by Apple.

The third is provided by someone else. If you’re going to use MacPorts to manage your software, you should uninstall things from /usr/local; they can interfere with MacPorts.

>  ## And as it turns out the last is the latest, so I do
>  /usr/local/bin/php --version
>  ## I get
>  PHP 5.4.24 (cli) (built: Jan 10 2014 18:15:38)
>  Copyright (c) 1997-2013 The PHP Group
>  Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
>  ## I then install gd for that version
>  ## 
>  Looks like I have gd enabled for that version now. So, by
>  symlinking or changing my $PATH I will have as default the latest
>  version.
>  I am still showing php 5.3.26 when I point my browser to a
>  phpinfo()
>  I know this next question is on the boundaries of purview for this
>  ML, and will research it further, but if you can tell me how to
>  enable php 5.4.24 for apache, I would appreciate it.

Figure out how your web server is configured to use php. First of all, are you using MacPorts php or one of the others? Are you using the MacPorts apache2 web server? Or a different MacPorts web server such as nginx or lighttpd? If you’re using apache, are you using the php apache module? Or are you using php fastcgi, or php fpm? All of these questions affect the answer to the question of how you upgrade to a newer version.

Figure out what php ports you have installed, using:

port installed name:php

If you’re using the php5* ports, you should upgrade to newer ports. The current stable version of php is 5.5.x. You can get that with the php55* ports in MacPorts. You can even try out the newest alpha version 5.6.x if you want with the php56* ports.

If for example you are using MacPorts apache2 with the php apache module, you would want to install the php55-apache2handler port to use php 5.5.x. You’ll also have to follow the instructions the port will print when you install it (or you can review them anytime by running “port notes php55-apache2handler”) and you may also have to manually edit your web server configuration files.

More information about the macports-users mailing list