On FreeBSD the ports and the OS are two separate entities and all versions of FreeBSD use the exact same ports tree. So it's perfectly possible to have FreeBSD 10.4 with PHP 7.1 and FreeBSD 11.1 with PHP 5.6.
Indeed. We have been using FreeBSD for 15 years in our production facility, exactly because building from ports gave us such great control over the php version with all it's extensions (apart from just being a kickass OS).
However, with the (relatively) recent change to "binary packages preferred" approach, we have switched to using pkg for building our servers, rather than ports. This has been mostly fine (and much quicker!), however with the upgrade to php7* and the default php version on FreeBSD remaining at php56, we have ended up building some (mainly pecl) extensions from ports (using the make.conf default version setting).
This quickly gets messy, as a "pkg upgrade" now "breaks" and tries to install php56 again. This is the main reason we have not yet upgraded our production machines to php7.
Is there any better way? The ones we are aware of:
1. run a poudriere server to build our "custom" packages and then pkg install them on all the production machines. (We suspect this just moves the same problem to the poudriere machine ? unless we go back to building everything from source on there..)
2. go back to building all our machines from source.
3. patiently wait for the FreeBSD ports team to change its default version to php7* (probably php73 by the time we get there?)
Is there any plan for 3.? I have not seen any discussion anywhere.
Don't get me wrong, I am not complaining, just wondering what the best path is.
Many Thanks