Recently I had updated from Xubuntu 12 to 14.04. After programming for a while i needed to use the mcrypt function to help generate a salt. To my frustration, the same script that once worked worked no longer
$salt = base64_encode(mcrypt_create_iv(24, MCRYPT_DEV_URANDOM));
Would now break my script.
I found the answer after a tedious search.
Now - I only needed to enable the script as mcrypt.ini was already in mods-available, but i will leave that part in because it may help someone else.
Source: http://www.devraju.com/about-me/ubuntu-13-1014-04-mcrypt-missing-fatal-error-undefined-function-mcrypt_encrypt/#comment-839735