php - Virtual host showing contents of file instead of serving the app
one text
Solution:
Does any PHP work with the Apache server? Generally when this happens it’s because the PHP module hasn’t been installed.
Try this:
sudo apt install libapache2-mod-php
You will need to restart Apache after the installation to ensure the module is properly applied:
sudo service apache2 restart
Source