Fix for PHP Issues after upgrade to Ubuntu 16.04.1 (Xenial)
After updating from Ubuntu 14.04, the php and Apache stopped being friends and one of the WordPress site I maintain went all white and admin page was just showing php code.
This is apparently because of a known issue in 16.04 with upgrade to php7 as shown on the ubuntu forum here.
Using the guidance from this link and with some more of duckduckgo search later, I managed to resolve the problem thus:
#1. Install aptitude if it is not already installed using sudoapt-getinstallaptitude
#2. Removed php7 and unwanted php usingsudoaptitudepurge`dpkg-l|grepphp|awk'{print $2}'|tr'\n'' '`#3. Added old repo usingsudoadd-apt-repositoryppa:ondrej/php
#4. Updated reposudoapt-getupdate
#5. Installed php5.6sudoapt-getinstallphp5.6
sudoapt-getinstallphp5.6-mbstringphp5.6-mcryptphp5.6-mysqlphp5.6-xmlphp5.6-curlphp5.6-gdphp5.6-zip
#6. Checked php versionsudophp-v
#7. Enabled mod_phpsudoa2enmodphp5
Ignorederrormessage
#8. Opened php5.6 confsudonano/etc/apache2/mods-enabled/php5.6.conf
#9. Commented following lines<IfModulemod_userdir.c>
<Directory/home/*/public_html>
php_admin_flagengineOff
</Directory>
</IfModule>
#10. Restarted the serversudoserviceapache2restart
Comments from Disqus
As I plan to move away from disqus comment system, I am just including the screenshots of comments just so any information shared by or to the readers is retained.