Installing Web Server: Apache, PHP, and MariaDB
Install the following Apache, PHP and MariaDB applications and dependecies.
sudo apt install php php-apcu php-bcmath php-cli php-common php-curl php-gd php-gmp php-imagick php-intl php-mbstring php-mysql php-zip php-xml mariadb-server -yEnable the following modules in Apache.
sudo a2enmod dir env headers mime rewrite sslEnable the following modules in PHP.
sudo phpenmod bcmath gmp imagick intlRun MySQL Secure Installation.
sudo mysql_secure_installationDisable Apache’s default site.
sudo a2dissite 000-default.confRestart Apache.
sudo systemctl restart apache2PHP Configuration
Open PHP’s ini file.
sudo nano /etc/php/8.3/apache2/php.iniUse the search function in your text editor to find these setting and make the following changes (matching them except for your timezone if different and your desired upload file size).
Where I state to “un-comment”  a field, I’m referring to removing the semicolon preceeding it.
memory_limit = 512MMaximum upload file size. (In this example, the maximum file size is 10,240 megabytes or 10 gigabytes. Yours can be smaller or larger.)
upload_max_filesize = 10240Mmax_exectuion_time = 360Maximum size of POST data must match that of upload file size.
post_max_size = 10240MUn-comment and add your timezone. Click here to find your timezone.
date.timezone = America/Los_AngelesUn-comment.
opcache.enable = 1Un-comment.
opcache.interned_string_buffer=16Un-comment.
opcache.max_accelerated_files=10000Un-comment.
opcache.memory_consumption=512Un-comment.
opcache.save_comments=1Un-comment.
opcache.revalidate_freq=2Save file and exit editor. Then restart Apache.
sudo systemctl restart apache2