Getting the application runtime in place.
CHOOSING A VERSION
Use the newest version your applications support. Older versions stop receiving security patches, and running one is a genuine risk.
Check your application's requirements before choosing.
MULTIPLE VERSIONS
If you host several applications with different requirements, you can run multiple PHP versions side by side and assign per site. Control panels handle this; manually it requires more configuration.
COMMON EXTENSIONS
curl, gd or imagick, mbstring, zip, intl, xml, bcmath, soap, exif, fileinfo, and the database drivers mysqli and pdo_mysql.
Install what your applications need rather than everything available.
CONFIGURATION
memory_limit, upload_max_filesize, post_max_size, max_execution_time and max_input_vars are the settings most often needing adjustment.
Set them in the PHP configuration and restart the relevant service.
PHP-FPM
The usual way to run PHP with both Apache and Nginx. It runs PHP as a separate pool of processes, which you can tune for your memory allocation.
Pool sizing matters: too many processes exhaust memory, too few queue requests.