A version of php comes defaultly installed in any mac OS Install Homebrew and run the following command brew install php