Note that the installiation of nginx+php5 on MACOSX IS NOT RECOMMENDED unless you know what you're trying to do.
- both services are going to be running as root
- there is no configuration file set for php-cgi53
Tested on OSX 10.10.2 (Yosemite)
Refer to https://gist.github.com/renjunkui/1267057 for lower versions of MACOSX.
# install MacPorts at http://www.macports.org/install.php
user$ sudo su
Password:
root$ port selfupdate
root$ port update outdated
root$ port install nginx
root$ port install php53 +fastcgi fcgi # insert php53-(extension name) if required
root$ mkdir /opt/local/etc/LaunchDaemons/org.macports.php-fastcgi
root$ nano org.macports.php-fastcgi.plist # or vim
root$ ln -s /opt/local/bin/php53 php
root$ ln -s /opt/local/bin/php-cgi53 php
root$ cd /Libarary/LaunchDaemons
root$ ln -s /opt/local/etc/LaunchDaemons/org.macports.php-fastcgi/org.macports.php-fastcgi.plist org.macports.php-fastcgi.plist
root$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.php-fastcgi.plist
you can set further settings at /opt/local/etc/*