0

After the upgrade to Ubuntu 16.04, php files in the public_html directory are not processed anymore by apache2. If I browse some page http://localhost/~myusername/index.php, the php code is rendered as plain text.

It might be related to the upgrade to php7.0, which (I think) replaced php5 in Ubuntu 16.04.

I already tried what is suggested in the following:

Any idea about what might be wrong?

Giove
  • 121

1 Answers1

1

I solved reinstalling PHP, as follows.

sudo aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
sudo apt-get install php7.0 php7.0-fpm php7.0-mysql libapache2-mod-php
sudo a2enmod php7.0
sudo service apache2 restart

I also edited the file /etc/apache2/mods-available/php7.0.conf in order to allow PHP in user directories (and then, again, restarted apache2).

Giove
  • 121