Even if you install XAMPP on Mac, the mac still runs the PHP that it already has rather than using the PHP of XAMPP and this could become a big problem if there is a version difference.

Wait, don’t get frustrated, in only 5 steps you can tell your mac to use the XAMPP’s php rather than its own. The steps are as follow:

  1. Open terminal and type  vim ~/.bash_profile
    A new window will open.
  2. Type i to insert words into the editor and copy and paste the following: (the mouse click won’t work so use CMD+C and CMD+V):
    export PATH=/Applications/XAMPP/bin:$PATH
  3. Hit ESC: Then type:wq and hit enter to save
  4. In terminal type source ~/.bash_profile
  5. Check by typing which php in terminal.

Yup, it’s that easy.  You can then verify by typing WHICH PHP on terminal.