pkg
This is the easiest way; but you have to stick to the default php version for FreeBSD at the moment of your installation.
ports
With this method, you will end up having a more fine-grained installation; for example, you can choose a different php version from the default.