I have installed apache2 and php7.2 on linux mint and the apache2 is working but does not work with php7.2
I have tried several fixes but none work. Here are some tests I did:
david@david-Satellite-L750D:~$ sudo a2query -m php7.2
[sudo] password for david:
php7.2 (enabled by maintainer script)
david@david-Satellite-L750D:~$ php -v
PHP 7.2.24-0ubuntu0.18.04.4 (cli) (built: Apr 8 2020 15:45:57) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.24-0ubuntu0.18.04.4, Copyright (c) 1999-2018, by Zend Technologies
sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset:
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: active (running) since Fri 2020-04-17 20:44:55 AEST; 6min ago
Process: 855 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCES
Main PID: 1007 (apache2)
Tasks: 6 (limit: 3999)
CGroup: /system.slice/apache2.service
I get a blank page with php code echo phpinfo() in my browser;
You seemed to have installed PHP, that's great, no now need to "bind it" to Apache, you will need to install libapache2-mod-php and then, all the PHP librairies you may need.
You should take a look at your community link (old, but you can replace it by the PHP version of your choice): https://community.linuxmint.com/tutorial/view/486