Know installation source of PHP I'm finding myself in an awkward situation. I need to install PHP and Nginx for development but I do not want to mess up my Mac with multiple installations. I have found that PHP and PHP-fpm are already installed. I would like to uninstall but I have no clue on how to do it as I don't know through what means it has been installed (Brew or Ports).

I have searched the php binary and it is in /usr/bin/

PHP 5.5.30 (cli) (built: Oct 23 2015 17:21:45) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

Mac OS X El Capitan 10.11.3
PHP 5.5.30 (cli) (built: Oct 23 2015 17:21:45) is the version of php shipped by Apple with OS X 10.11.3.

You can use brew to install a current version of php – without affecting the built-in version.

brew installs its binaries in /usr/local/Cellar. A modification to your PATH ensures the brew installed version is found before the OS X provided version.

MacPorts uses a similar approach. Which package provider you use is a matter of personal preference.

Install php via brew

To install php via brew, first install brew using the instructions on their web site:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


Then install php:

brew install php


Remove php via brew

When you need to remove php installed via brew – thus reverting php back to the version shipped with OS X – run:

brew uninstall php