NOTE: I like to prepend some of the commands with
time
just for curiosity’s sake to see how long it takes.
Go to System Preferences -> Sharing -> uncheck the Personal Web sharing. You will never turn Apache on/off here again.
macappstore://itunes.apple.com/app/xcode/id497799835?mt=12
Find the latest version in the Mac Dev Center. (You must have a free Apple Developer account.)
Either launch Xcode via GUI or run xcodebuild -license
Use the Mac OS X Package (.pkg) Installer.
The installer will prepend your $PATH with the necessary /opt/local/bin:/opt/local/sbin:
As of Xcode 4.3 you need to make sure Xcode knows where to look.
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/
sudo /opt/local/bin/port -v selfupdate
time sudo port install curl +ssl
time sudo port install php54 +apache2 php54-apache2handler php54-curl php54-gd php54-exif php54-geoip php54-http php54-iconv php54-imagick php54-imap php54-mbstring php54-mcrypt php54-mysql php54-pear php54-pcntl php54-posix php54-soap php54-sockets php54-sqlite php54-xmlrpc php54-xsl php54-openssl php54-xdebug php54-zip
nano ~/.bash_profile
Add the following line
export PATH=/opt/local/apache2/bin:$PATH
sudo /opt/local/apache2/bin/apxs -a -e -n php5 /opt/local/apache2/modules/mod_php54.so
Probably only necessary if you are upgrading from PHP 5.3 Hat Tip
sudo port select --set php php54
sudo ln -s /opt/local/etc/php54/php.ini-development /opt/local/etc/php54/php.ini
If you’re using the free GeoLite database PHP will probably not find it in the default install location.
sudo ln -s /opt/local/share/GeoIP/GeoIP.dat /opt/local/share/GeoIP/GeoIPCity.dat
time sudo port install mysql55 mysql55-server
nano ~/.bash_profile
Add the following line
export PATH=/opt/local/lib/mysql55/bin:$PATH
MacPorts’ MySQL looks for my.cnf
in the standard paths as defined by MySQL
You can put this in the global spot: /etc/my.cnf
or the one specific to this MySQL install /opt/local/etc/mysql55/my.cnf
The my.cnf
should also set the datadir
where your data files reside. I like /private/var/mysqldata
(to avoid collisions with Apple’s old location of /private/var/mysql
)
sudo mkdir -p /private/var/mysqldata
sudo chmod 750 /private/var/mysqldata
sudo chown _mysql /private/var/mysqldata
NOTE: You probably need to update the
mysql.sock
paths in yourphp.ini
to reflect/opt/local/var/run/mysql55/mysqld.sock
. There are 3 possible places you may need to set this.
If this is a fresh MySQL install and you're not re-using existing data install the default tables
sudo -u _mysql /opt/local/lib/mysql55/bin/mysql_install_db
This installs and activates a launchd item.
NOTE: Do not be confused by MacPorts' documentation referring to StartupItems. StartupItems is their term for special scripts that create launchd items I have no ide why they would choose terminology that makes you think it is a 10.4 (pre-launchd) StartupItem (which are deprecated).
sudo port load mysql55-server
To stop MySQL use
sudo port unload mysql55-server
sudo /opt/local/lib/mysql55/bin/mysql_secure_installation
If you don’t set a root password when it asks you to just ring your call button, and Tommy will come back there and hit you over the head with a tack hammer because you are a retard
sudo /opt/local/lib/mysql55/bin/mysql_upgrade -uroot -p
time sudo port install git-core
time sudo port install ruby rb-rubygems
time sudo gem install capistrano capistrano-ext rack
time sudo gem install capistrano-mailgun
sudo port load apache2