Upgrade from PHP5.4 to PHP5.5 on MacPorts

Install necessary package

% sudo port install php55 php55-apache2handler php55-curl php55-gd php55-imagick php55-intl php55-mbstring php55-mcrypt php55-mysql php55-openssl php55-pear php55-postgresql php55-xdebug php55-zip


Create php.ini

cp /opt/local/etc/php55/php.ini-development /opt/local/etc/php55/php.ini


Edit php.ini

data.timezone、socket add to php.ini

date.timezone = Asia/Tokyo

pdo_mysql.default_socket ="/opt/local/var/run/mysql56/mysqld.sock" mysql.default_socket ="/opt/local/var/run/mysql56/mysqld.sock" mysqli.default_socket ="/opt/local/var/run/mysql56/mysqld.sock"


module add to httpd.conf

cd /opt/local/apache2/modules
    sudo /opt/local/apache2/bin/apxs -a -e -n php5 mod_php55.so


comment out before confirmation

LoadModule php5_module        modules/mod_php55.so
LoadModule php5_module        modules/mod_php54.so // comment out


select php55

% sudo port select php php55
Selecting 'php55' for 'php' succeeded. 'php55' is now active.


Restart Apache and confirm normality

% sudo /opt/local/apache2/bin/apachectl -k restart
finish