Apache2 does not run php files [duplicate]

0

My php files do not run in the browser when accessing localhost (var / www / html / index.php). The code is displayed as if it were a plain text file.

System Settings: Apache2 Ubuntu 18.04 LRS Php 7.2.0

Is there a problem with the installation (apache2 or php) or configuration?

    
asked by anonymous 24.11.2018 / 16:22

1 answer

0

I was able to solve it. If someone had the same problem, first I uninstalled php:

sudo apt-get purge php7.*

Then I reinstalled

sudo apt-get install php

and enabled for apache 2

sudo a2enmod php7.0

sudo systemctl restar apache2
    
24.11.2018 / 16:38