OS X development environment
Recently I upgraded my iMac to Sierra. The most annoying thing about upgrading is that every time I do, any system files I've modified get overwritten. This is most noticeable in the case of the Apache server, which requires some messing about in /etc to configure.
Normally it's just a bit of a pain, but this time something went wrong and I had to do a clean install. So, future me reading this: don't screw it up again, K?
What went wrong
No idea. Probably something PHP-related.
Was all going great until I tried upgrading to PHP7.
Initially tried the brew version:
> brew install php70
> brew info php70
> brew uninstall php70
> brew install php70 --with-apache
Followed the rest of the brew instructions to get Apache using PHP 7 by modifying httpd.conf, and still couldn't get it working. So I tried installing php7 from here instead. Not really sure what went wrong, but soon thereafter Apache stopped working properly. I still got the default page, but that's about it. PHP files weren't being interpreted and virtual hosts were ignored. I also noticed that restarting the machine now always failed, hanging forever, so needed to use the power switch.
Installation USB drive
Ok future me, if you do need a clean install, remember to back up:
- home directory
Make especially sure you copy .vimrc and .inputrc from home directory. Here are my versions of them, for when I lose them.
set nocompatible set autoindent set smartindent set incsearch set ignorecase set tabstop=4 set shiftwidth=4 set expandtab syntax on colorscheme koehler
set completion-ignore-case On set bell-style: Off
Restart holding option key, select USB drive for launch when prompted. Follow instructions.
BasicsCopy over .vimrc, .inputrc
Copy over required stuff from home directory
Open App Store & install XCode
HomebrewGo to Homebrew site and follow instructions.
> brew install macvim > brew install node > brew install npm > npm install -g bower > sudo pip install selenium
ApacheSet up Apache
Set up virtual hosts
Remove root password:
> mysql -u root -p # enter temporary password > ALTER USER 'root'@'localhost' IDENTIFIED BY ''Install Sequel Pro
Migrate any databases
> mysql -u root -D'some_db' < /some/sql/file.sql
And I still haven't got PHP7 working...