Install PHP 5.3 and 5.4 suitable for FLOW3 using MacPorts
PHP packages
============
First of all, install all the packages needed (some are optional, but they do no harm, either).
PHP 5.3
-------
::
sudo port install php53 \
php53-{apache2handler,apc,curl,gd,gettext,iconv,igbinary,mbstring,memcache,mysql,openssl,pear,posix,postgresql,redis,sockets,sqlite,xdebug,xhprof}
PHP 5.4
-------
::
sudo port install php54 \
php54-{apache2handler,apc,curl,gd,gettext,iconv,igbinary,mbstring,memcache,mysql,openssl,pear,posix,postgresql,redis,sockets,sqlite,xdebug,xhprof}
Customize configuration
-----------------------
Copy /opt/local/etc/php5(3|4)/php.ini-development (or production) to /opt/local/etc/php5(3|4)/php.ini and adjust as needed.
Chose active PHP version
========================
For CLI use selecting a PHP version is now easy::
port select php php53
Selecting 'php53' for 'php' succeeded. 'php53' is now active.
port select php php54
Selecting 'php54' for 'php' succeeded. 'php54' is now active.
Activate Apache modules
=======================
::
cd /opt/local/apache2/modules
sudo /opt/local/apache2/bin/apxs -a -e -n php5 mod_php53.so
sudo /opt/local/apache2/bin/apxs -a -e -n php5 mod_php54.so
This will leave you with an unusable configuration, because only one PHP module can be loaded. But once both lines are there, you can comment one, to switch between versions.
Upgrading from php5
===================
* remove old cruft: ``port uninstall 'php5-'``
* remove ``/opt/local/etc/php5``
* remove old module loading directive from ``httpd.conf``