Best way to upgrade PHP 5.3 to 5.4

Ryan Schmidt ryandesign at
Thu Apr 18 21:14:05 PDT 2013

On Apr 18, 2013, at 21:55, Tim Johnson wrote:

> * Ryan Schmidt [130418 18:49]:
>> You can use
>> 	port installed | grep php
>> to see if you have any MacPorts php installed; if you do, chances are you're using that.
>  Null response from grep, so this is a 'native' install?

Perhaps you're using the PHP that comes with OS X. Or perhaps you installed another copy somewhere.

Are you using PHP in a web server? If so, what web server? OS X's included copy of Apache 2 or something else? Its configuration file will no doubt have an entry for enabling PHP which should help you figure out where it is.

>> If you want php 5.4 for use as an Apache module, you would:
>> 	sudo port install php54-apache2handler
> Understood, and previously would I invoke 
> sudo port install php54

Previously, you would use

	sudo port install php5 +apache2

The php5 port is part of the "old" MacPorts PHP world. Instructions for the "old" way are part of this documentation:

A year ago I rewrote PHP in MacPorts. The new MacPorts PHP world is composed of multiple ports with prefixes php53, php54 and php55 to let you choose the version(s) you want to use. Our documentation still needs to be updated to explain these new ports.

Aside from the Apache 2 module in the php54-apache2handler port, you also have the choice of using php54-cgi or php54-fpm; as I understand it, FPM is the "new hotness" for PHP:

The php54 port itself contains the command-line version of PHP and some support files, which you will get in any case.

More information about the macports-users mailing list