To find which shell you are using, navigate to your console and execute the following command: Now if you type php -v at the command line you should version 5.6 being displayed.
Ensure you are connected to the Internet before opening up your Terminal application (located in Applications/Utilities) and then issue the following command: You will then be prompted for your password by the installer and, within a few seconds after entering your password, the package will be successfully installed on your system. The problem here is that although we installed a more up to date PHP binary Mac OS X doesn't know that it's supposed to use that instead of the default PHP installation.
Rectifying this is relatively simple but involves a bit more command line work.
One of the important El Capitan changes is the introduction of something called System Integrity Protection or “SIP”.
SIP prevents everyone (even root) from writing to many system directories such as directory.
I use the local Apache and PHP web development environment of Mac Os X for several of my projects.
After upgrading my OS to the latest version, OS X 10.11 El Capitan, I had to take multiple steps to get everything back up and running.
This and a number of other php extension config files can be found here /usr/local/php5/php.d/ Open up the file 50and add the following line to the end That will resolve it.
You may need to logout and log back in for PHP to refresh its configuration.
The new php binary is therefore in /usr/local/php5/bin/php.