If you’re running the latest OS X 10.10.5 beta you will run into issues when previewing a page with the PHP extension. This is due to a bug in the beta release of OS X whereby the system’s version of PHP fails to load a necessary sub-module. The sub-module has been updated to a newer version number in the latest 10.10.5 beta, but the PHP version itself hasn’t.
A workaround is available in this blog post - but please proceed at your own risk. I’d imagine this is something Apple will fix in a future beta…