How To Install Php Mcrypt On Ubuntu Server
Table of Contents
You should now have phpMyAdmin configured and ready to use on your Ubuntu 16.04 server. Using this interface, you can easily create databases, users, tables, etc., and perform the usual operations like deleting and modifying structures and data. To install this extension on PHP 7.2, run the following commands as your server's root user: sudo apt-get -y install gcc make autoconf libc-dev pkg-config sudo apt-get -y install libmcrypt-dev sudo pecl7.2-sp install --nodeps mcrypt-snapshot. To install the mcrypt php extension, do this: sudo apt-get install php5-mcrypt and restart the server sudo service apache2 restart By the way, this might be off-topic, but let’s be honest: Laravel. How to install the mcrypt php extension (to use Laravel 4).
cguzmana at gmail dot com ¶Resolved my problem on Ubuntu 14.04:
$sudo apt-get install php5-mcrypt
$sudo php5enmod mcrypt
Same Problem on Linux Mint - Call to undefined function mcrypt_create_iv..
Solved by adding the folowing line to the php.ini
extension=mcrypt.so
After that a
service apache2 restart
solved it..
Have fun with it..
debian/ubuntu php5 (>= 5.4.0~rc6-1) has introduced two new commands:
php5enmod and php5dismod
# install the extension
sudo apt-get install php5-mcrypt
# you can see that it's installed by the presence of the .ini file
cat /etc/php5/mods-available/mcrypt.ini
# enable it
sudo php5enmod mcrypt
# reload Apache to make use of the extension
sudo service apache2 reload
Issue Solved when installing php7.2-mcrypt
I was also facing the same issue. Check this link https://stackoverflow.com/q/48275494/7713811
to get the right solution for installing it in PHP
For PHP-7 UNIX Server use this
sudo apt-get install mcrypt php7.0-mcrypt
sudo service apache2 restart
On ubuntu 8 (hardy), the mcrypt library seems to be here.
/usr/lib/php5/20060613/mcrypt.so
So I just created mcrypt.ini in /etc/php5/conf.d and added this one liner.
extension=mcrypt.so
Also on Ubuntu, make sure you actually have php5-mcrypt installed. You can install it with:
sudo apt-get install php5-mcrypt
If you get any errors, you may need to enable the 'universe' repository, explained here:
https://help.ubuntu.com/community/Repositories/Ubuntu
Using PHP version 'PHP Version 5.3.10-1ubuntu3.4' and Ubuntu 12.0.4 on Apache2..
Make sure you have mcrypt installed and active on your php5 install. Use 'sudo apt-get install php5-mcrypt' to install, that should sort the issue.
The following link solved my problem
[Tue Dec 24 12:42:33.003683 2013] [:error] [pid 8448] [client 127.0.0.1:33146] PHP Fatal error: Call to undefined function mcrypt_decrypt() ..
http://stackoverflow.com/questions/4809611/problem-with-mcrypt-installation/20208943#20208943
To make sure that mcrypt doesn't fail to load when
using Windows XP , Apache 2 and php 5, even if all the required procedure to install it has been accomplished already, copy libmcrypt.dll, which is normally in the php main directory, into the phpext directory.
PROBLEM: cannot load mcrypt extension. please check your php configuration
I have done as suggested by the contributor before me and copied libmcrypt.dll from F:wampbinphpPHP52~1.8
to C:WINDOWSsystem32 . This did not work on it's own. I found other advice as follows and now mcrypt is working.
OTHER ADVICE:
Go to F:wampbinphpPHP52~1.8php.ini
change ;extension=php_mcrypt.dll
to extension=php_mcrypt.dll
(ie. remove ; )
now go to the following 2 files and do the same:
F:wampbinphpPHP52~1.8phpForApache.ini
F:wampbinapacheAPACHE~1.11binphp.ini
Please adjust the directory location per your own installation.
On Windows installations, for the dynamic extension (extension=php_mcrypt.dll) to load properly, you must copy libmcrypt.dll from your PHP root folder (e.g. C:PHP) to the following location:
C:WINDOWSsystem32
With this done, the dynamic extension will load up just fine.
- Mcrypt
The php mcrypt extension on ubuntu 14.04 shows that it is installed properly, but phpmyadmin says:
My current php config is here. If you need anymore information, please contact me through the comments.
14 Answers
Try this:
Should show it located at /etc/php5/mods-available
Edit mcrypt.ini and change extension to match the path to mcrypt.so, example:
Now this:
Verify that new files exists here (they should be auto created from the issue above)
Otherwise do the following
Create symbol links now
Restart Apache
Restart php5 or php5-fpm
KevsinKevsinTry just doing this:
And then:
I have installed fresh Ubuntu 14.04 (desktop version) to my computer. This way works for enabling mcrypt that was already installed.
Eliah KaganInstall mcrypt
extension for PHP, Enable it, and Restart Apache. Following are the commands to do:
The php5-mcrypt Ubuntu package install the config file mcrypt.ini
into /etc/php5/conf.d/
which is the old PHP config directory layout.
The current way of working to enable modules in PHP5 is to put the ini files in the /etc/php5/mods-available
directory.Then, to enable the module in PHP5, you have to create a symbolic link to the related ini files from /etc/php5/apache2/conf.d
directory to enable the module when PHP is used under Apache or / and from /etc/php5/cli/conf.d
if you want to have this module enabled when you use PHP outside Apache, in scripts run at the command line or from crontab.
Also note that in the conf.d
directory, you can create the link to the ini file by putting a number in front of it to have the modules loaded in a specific order. Usefull when you need to load a module depending on another one.
Of course, don't forget to restart Apache if you have enabled the module for Apache :
BenoitBenoitMy 14.04 server install only needed (after php5-mcrypt installed)
If the Problem still occurs,
enable the module by adding: extension=mcrypt.so
to
/etc/php5/cli/php.ini
and
/etc/php5/apache2/php.ini
snickers2ksnickers2kIn Ubuntu 16.04 LTS, to enable the mcrypt module, with php 5.6:
or with php 7.0:
and then
You should be able to install the mcrypt extension for PHP by running:
Note that in Ubuntu 14.04 the php5-mcrypt is in the universe repository that could be disabled. In this case to install it you must enable the repository with:
Joomla: How To Install Php Mcrypt On Xampp
This is the best way to add php 5.5 mcrypt extension on Ubuntu 14.04 Server
@Kevsin's answer worked for me, but I had to run mkdir -p /etc/php5/apache2/conf.d/
and manually run the sudo ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/apache2/conf.d/20-mcrypt.ini
to get to work. sudo php5enmod mcrypt
worked fine for the first symlink.
Note: I'm running PHP5-FPM. That may have been the difference.
For those who find this, for Ubuntu 16.04 (using PHP7), here is what I did to enable mcrypt: