This tutorial will show you how to install PHP 7.4 on FreeBSD 12.1.
PHP is a server-side scripting language designed for web development.
FreeBSD has an awesome packaging team and most packages are kept up to date with the latest releases of the software. Hence the installation is simple.

To install PHP 7.4 with pkg, run this command:

sudo pkg install php74

To confirm the installation, check the PHP version with this command:

php -v
# PHP 7.4.0 (cli)

If you want to install some PHP 7.4 modules, you can do so as well with pkg.

To search for available PHP 7.4 modules, you can use pkg search and globbing:

pkg search ^php74-*

The results will be mostly PHP 7.4 modules that you can install.

If, after researching, you decide that you need to install a package, you can do so by using the pkg install command. Most PHP web applications will require additional modules, so it's good to know how to search for them.

That should be it. With an outstanding operating system as is FreeBSD, the installation of software is also simple and easy, as it should be.