I just followed the tutorial located at https://www.digitalocean.com/community/articles/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu while fixing multiple other er
Try this:
sudo apt-get install php5-mcrypt sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available sudo php5enmod mcrypt sudo service apache2 restart