The web enabled extensions and command line enabled extensions can differ. Run
php -m in your terminal and check to see if
mcrypt is listed. If it’s not then check where the command line is loading your
php.ini file from by running
php --ini from your terminal.
php.ini file you can enable the extension.
I have heard of people on OSX running in to problems due to the terminal pointing to the native PHP shipped with OSX. You should instead update your bash profile to include the actual path to your PHP. Something like this (I don’t actually use OSX so this might not be 100%):
On earlier versions of Ubuntu (prior to 14.04) when you run
sudo apt-get install php5-mcrypt it doesn’t actually install the extension into the
mods-available . You’ll need to symlink it.
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/mcrypt.ini
On all Ubuntu versions you’ll need to enable the mod once it’s installed. You can do that with
sudo php5enmod mcrypt
sudo service apache2 restart