Ubuntu – PHP not working after upgraded to Ubuntu 17.10

17.10PHP

After I upgraded to Ubuntu 17.10, PHP totally stopped working.
Everything works fine in Ubuntu 17.04.
The code for info.php as follows does not work:

<?php 
phpinfo();
?>

It is not showing PHP information, it only shows the source code like above.

Best Answer

Open terminal with ALT + CTRL + T and type in these commands:

sudo a2enmod php7.1
sudo systemctl restart apache2
Related Question