I recently reinstalled Apache and now my PHP code is shown directly instead of being ran. For example, if I go to example.com/info.php, all I see is:
<?php
phpinfo();
?>
I double checked PHP wasn't uninstalled. Is there some configuration setting somewhere I'm missing?
Solution (question is not duplicate)
This problem was because after the new install of Apache, the modules were not configured correctly. Something about thread vs events. Anywho, run these commands:
a2dismod mpm_event
a2enmod mpm_prefork
systemctl restart apache2.service
Now my php works perfectly