Apache2 & PHP showing blank page
22,651
Try the following:
Install php for Apache with
sudo apt-get install libapache2-mod-php
Restart apache with
sudo service apache2 restart
Place code to the
/var/www/html/phpinfo.php
:<?php phpinfo(); ?>
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, 21.04 and 21.10 too.
Related videos on Youtube
Author by
sevku
Updated on September 18, 2022Comments
-
sevku over 1 year
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.
-
fugitive over 6 yearsHe needs to reset
apache
service for modules to get loaded i believe.