Install php on Mac Yosemite
Any Mac built in the last 10 years comes with Apache and PHP installed and ready to go. All you need to do is run one command to start apache (apachectl start) and un-comment 1-2 lines in httpd.conf. installing massive packages that leave you with multiple copies is NOT necessary.

If you want a friendly interface and a box to check, get Apple's Server application.