I recently installed Linux Mint 18.3 Mate on a new PC. It all works fine but I am unable to install PHP successfully as part a LAMP set-up (for use via localhost).
I installed LAMP via the terminal with
sudo apt-get install lamp-server^ -y
The Apache test (the "It works!" page) is successful.
The PHP test (a file that simply has <?php phpinfo(); ?>
in it), though, produces a blank white page. The file is called "testphp.php" and I attempt to access it at localhost/testphp.php.
I have checked several potential causes of the trouble:
The phpinfo test file is in /var/www/html and I confirmed in the etc/apache2/sites-available/000-default.conf file that this directory is the document root.
I set display_errors = On in the /etc/php/7.0/apache2/php.ini file, but when I try the phpinfo test page, no errors appear.
I checked the /var/log/apache2/access.log file to confirm that the phpinfo test page accesses are recorded by the system. But no errors appear in the /var/log/apache2/error.log file on these access attempts.
I confirmed that I have a current libapache2-mod-php by running:
sudo apt-get install libapache2-mod-php
The terminal returned the message that it is already the newest version.
I confirmed that PHP 7 (7.0.22-0ubuntu0.16.04.1) is running with
php -v
at the terminal.
What else should I check or do to troubleshoot this problem?
Thank you for your help!