Setting up PHP5.6 with MacPorts

sudo port install php56 php56-curl php56-fpm php56-gd php56-geoip php56-gettext php56-iconv php56-imagick php56-mbstring php56-mcrypt php56-mysql php56-openssl php56-opcache php56-redis php56-xdebug
sudo port select --set php php56
sudo cp /opt/local/etc/php56/php.ini-development /opt/local/etc/php56/php.ini

Create the following PHP56-FPM config file: /opt/local/etc/php56/php-fpm.conf

[global]

error_log = log/php56/php-fpm.log
syslog.ident = php56-fpm
daemonize = no

[www]

user = nobody
group = nobody

listen = /var/run/php5-fpm.sock
listen.owner = nobody
listen.group = nobody
listen.mode = 0660

pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
slowlog = log/$pool.log.slow
catch_workers_output = yes

php_flag[display_errors] = on
php_admin_value[error_log] = /var/log/fpm-php.www.log
php_admin_flag[log_errors] = on
php_admin_value[memory_limit] = 64M
sudo port load php56-fpm

PHP FPM will be accessible via: /var/run/php5-fpm.sock

Sample Nginx config:

server {
    listen       80;
    index index.php index.html;
    root /www;
    location / {
        # try to serve file directly, fallback to app.php
        try_files $uri /app.php$is_args$args;
    }
    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTPS off;
    }
}