Apache2 does not run php files

Asked

Viewed 796 times

0

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

Configs of the system: Apache2 Ubuntu 18.04 LRS Php 7.2.0

Any problem with installation (apache2 or php) or configuration?

1 answer

1

I managed to solve. If someone had the same problem, first I uninstalled php:

sudo apt-get purge php7.*

then installed again

sudo apt-get install php

and enabled for apache 2

sudo a2enmod php7.0

sudo systemctl restar apache2
  • t was missing in Restart I could not edit because it is a small error, I also used 7.4 instead of 7.0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.