I've tried to install PHP and Apache2, however when I access the file, it just shows a blank page.
I've installed the packages php, apache2, php-mysql (and some others)
I've already tried pretty much everything that I could find on the Internet.
I'm sorry if I'm not providing enough info, I will give any info that I can.
Best Answer
Try the following:
Install php for Apache with
sudo apt-get install libapache2-mod-php
Restart apache with
Place code to the
/var/www/html/phpinfo.php
:Navigate web-browser to
http://localhost/phpinfo.php
.These steps will help to check that PHP is working normally.
Note: this method works for Ubuntu 18.04 LTS, 20.04 LTS and 20.10 too.