sudo apt install \
autoconf \
bison \I recently got a new Macbook Pro and wanted to document how I setup my PHP environment. I like full control of how PHP is built and I usually build it from source. I do this because I often add custom extensions and modules not found in the common PHP OSX installers. If your looking for a easier method than building from source try https://php-osx.liip.ch/.
NOTE: This post assumes you are running a fresh install of MacOS Sierra 10.12.16 with System Integrity Protection disabled. If you don't know how to disable it just boot into recovery mode and open a terminal and type
csrutil disable, or google search it :) This post also assumes you are using Zsh instead of Bash shell. If you are using Bash you can replace anytime you see~/.zshrcwith~/.bashrc.
First lets get some of the prerequisites. Start by grabbing the command line tools neccessary:
xcode-select --install| # Delete all logs | |
| TRUNCATE ps_log; | |
| # Delete old connection data (only used for stats) | |
| # change 2016-02-01 00:00:00 according to you needs | |
| DELETE c, cs | |
| FROM ps_connections c | |
| LEFT JOIN ps_connections_source cs ON (c.id_connections = cs.id_connections) | |
| WHERE c.date_add < '2016-02-01 00:00:00'; |