Howto enable gd for PHP 5.3.28

Ryan Schmidt ryandesign at
Sun Feb 9 18:35:58 PST 2014

On Feb 9, 2014, at 19:56, Tim Johnson <tim at> wrote:

> * Ryan Schmidt <ryandesign at> [140209 16:20]:
>  /usr/local/bin is a symlink pointing to
>  /opt/local/bin/php54
>  So, with your previous instructions regarding 
>  paths to binaries, I have a handle on how to symlink new installs.

No need to manually create a php symlink. Instead use:

sudo port select php php54

if you want “php” to be php54.

>> 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.
>  # From
> port installed name:apache
> The following ports are currently installed:
>  apache2 @2.2.23_0+preforkmpm
>  apache2 @2.2.24_0+preforkmpm
>  apache2 @2.2.25_0+preforkmpm
>  apache2 @2.2.26_0+preforkmpm (active) 

Ok, so you have MacPorts apache2 installed. Still, that doesn’t tell me whether that’s the apache you’re using.

> # from /private/etc/apache2/httpd.conf 
> LoadModule php5_module libexec/apache2/
> # I am presuming that I have the php apache module

That httpd.conf file is for Apple’s apache, not MacPorts’ apache. MacPorts’ apache2 httpd.conf is in /opt/local/apache2/conf.

>> Figure out what php ports you have installed, using:
>> port installed name:php
>  #Using
>  port installed name:php | grep \(active\)

You could also use:

port installed name:php and active

>  #I see
>  php5 @5.3.28_0+apache2 (active)
>  php5-apc @3.1.9_1 (active)
>  php5-intl @5.3.28_0 (active)
>  php5-memcache @2.2.7_0 (active)
>  php53 @5.3.28_0+libedit (active)
>  php53-gd @5.3.28_1 (active)
>  php53-mysql @5.3.28_0+mysqlnd (active)
>  php53-sqlite @5.3.28_0 (active)
>  php54 @5.4.24_0+libedit (active)
>  php54-APC @3.1.13_0 (active)
>  php54-gd @5.4.24_0 (active)
>  php54-intl @5.4.24_0 (active)
>  php54-mysql @5.4.24_0+mysqlnd (active)
>  php54-sqlite @5.4.24_0 (active)
>  php_select @1.0_0 (active)

Ok, so you have the old php5 world, the new php53 world, and the new php54 world installed. Perhaps there is some opportunity for you to uninstall the world(s) you don’t need anymore.

> # I can infer the packages from the output above ... yes?
>  php55-apc - *not found*
>  php55-intl - found
>  php55-memcache - found
>  php55-gd - found
>  php55-mysql - found
>  php55-sqlite - found
>  # have I overlooked php55-apc? Or can it be done without?

APC has basically been superseded by opcache. Try php55-opcache instead.

More information about the macports-users mailing list