50

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 errors that I came across along the way and I'm stuck with one last error. When I log in to phpMyAdmin, there's a huge red error at the bottom saying "The mcrypt extension is missing. Please check your PHP configuration.". I installed everything listed in the tutorial on Ubuntu 13.10 via putty.

Charles
  • 50,943
  • 13
  • 104
  • 142
crgsqdmn
  • 639
  • 1
  • 5
  • 7

7 Answers7

153

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
Marc Delisle
  • 8,879
  • 3
  • 29
  • 29
  • Funny I just got this today reinstalling the lamp stack. Thanks! – slinky2000 Mar 31 '14 at 19:47
  • 36
    After fresh ubuntu 14.04 and LAMP install, all I needed to do was add the mod: sudo php5enmod mcrypt. cheers. – Jadeye May 28 '14 at 11:02
  • 1
    I got "ln: failed to create symbolic link /etc/php5/mods-available/mcrypt.ini: File exists" when executing second line. It seems its already done for you in the first step. – Basil Musa Dec 15 '14 at 22:45
  • @BasilMusa thanks; which Ubuntu version are you running? – Marc Delisle Dec 17 '14 at 15:49
  • Second line is too important, solve my issue thanks. +1 – Manwal Mar 20 '15 at 10:28
  • 1
    I followed every instruction here and in other places but in vain. ubuntu 14.04.3 -- PHP 5.5.9-1ubuntu4.14 -- nginx/1.8.1 -- Server version: 5.7.10 - MySQL -- Database client version: libmysql - 5.5.47 -- phpMyAdmin Version: 4.0.10deb1....anyone have an idea? – Jadeye Feb 02 '16 at 09:37
  • Still happening, and the server itself is not a dependency ? (Probably due to the MariaDB etc. ambiguity. Purging marks Apache2 as no longer required ? – mckenzm Mar 25 '16 at 00:15
  • @mckenzm Which phpMyAdmin version? – Marc Delisle Mar 26 '16 at 12:44
  • Apologies, my versions always come from Ubuntu repositories, currently Trusty, more specifically this version came from the aws sources for eu-west-1. (these are not strictly mirrors and they are not identical from region to region). So 4:4.0.10-1 but this is likely a package issue then. – mckenzm Mar 27 '16 at 10:13
  • Last two lines worked for me. Ubuntu server 14.04.4. – ourmandave Apr 28 '16 at 01:12
25

I've followed the exact tutorial with OP on digital ocean. The only steps that missing is to

sudo php5enmod mcrypt
sudo service apache2 restart 

and the error gone after restarting the apache service

Avyakt
  • 315
  • 4
  • 10
Izzat Z.
  • 437
  • 1
  • 7
  • 15
  • 1
    What those two command do is this: the 1st line is enabling module named 'mcrypt', and then restart apache2 to update the config. You can see the enabled module from `/etc/apache2/mods-available`. Enjoy LAMP life :) – kenju Oct 21 '15 at 09:57
6

Adding this answer for anyone who encounters this issue with Linux Mint 17.

Just installed a LAMP stack on and was getting this error. The mycrpt.ini file was already inst the /etc/php5/mods-available directory. All that needed to be done was to run the command to enable the module:

sudo php5enmod mcrypt

Restart apache after that and you'll be good to go.

SBerg413
  • 14,515
  • 6
  • 62
  • 88
1

I just stuffed a symbolic link into the Apache portion of php configuration. Platform: Xubuntu 14.04 LTS.

Details:

  1. cd /etc/php5/apache2/conf.d
  2. sudo ln -s ../../mods-available/mcrypt.ini 20-mcrypt.ini
  3. ls -l to see if the new link is there
  4. sudo apache2ctl restart

HTH.

jrasor
  • 11
  • 1
1

For those using a LEMP stack (nginx & php5-fpm), this is the solution

apt-get install php5-mcrypt
php5enmod mcrypt
service php5-fpm restart
service nginx restart

(run each with sudo, naturally)

Vercas
  • 8,931
  • 15
  • 66
  • 106
0

Try this:

sudo apt-get install mcrypt php5-mcrypt; php5enmod mcrypt; service apache2 restart
thucnguyen
  • 1,706
  • 15
  • 14
0

I am on a Mac OS X Yosemite using Terminal, and I fix this error

the requested PHP extension mcrypt is missing from your system

by running the following commands :

brew update
brew upgrade
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
brew install php54-mcrypt
code-8
  • 54,650
  • 106
  • 352
  • 604