1<?php
2// Step 1: Setup PHP with Apache2 HTTP Server
3
4sudo apt update
5sudo apt install apache2
6
7sudo systemctl stop apache2.service
8sudo systemctl start apache2.service
9sudo systemctl enable apache2.service
10
11// Step 2: Install PHP 7.4 to Support Apache2
12
13sudo apt-get install software-properties-common
14sudo add-apt-repository ppa:ondrej/php
15
16sudo apt update
17
18sudo apt-get install php7.4 libapache2-mod-php7.4 php7.4-cli php7.4-mysql php7.4-gd php7.4-imagick php7.4-recode php7.4-tidy php7.4-xmlrpc
19
20// Step 3: Configure PHP 7.4 for Apache2
21
22sudo nano /etc/php/7.4/apache2/php.ini
23
24file_uploads = On
25allow_url_fopen = On
26memory_limit = 256M
27upload_max_filesize = 100M
28max_execution_time = 360
29date.timezone = America/Chicago
30<IfModule mod_dir.c>
31 DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
32</IfModule>
33# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
34
35sudo systemctl restart apache2.service
36?>