How to remove preinstalled Apache and PHP from Mac OS Sierra I have been trying to figure out how to completely remove preinstalled Apache and PHP from my macbook pro ... The reason is that I am using the homebrew version of both Apache and PHP. The current version of PHP that I am using is PHP 7 as you can see in the screenshot below 



but when I use php -v in the terminal it shows me PHP version 5.6 .. see screenshot below.



I am trying to find the preinstalled PHP but can't seem to find it ... Can you guys help me out and point me to the right direction ? Thank You.
Removing system macOS binaries is not a good idea, they will be reinstalled during a next system upgrade and they could be needed by some system scripts.

To enable the homebrew php from the command line, read the output of brew info php70:


  If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc, ~/.zshrc, ~/.profile or your shell's equivalent configuration file:
    export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"


If you have installed php 7.2, check the output of brew info php72.