How To Install Php Mcrypt On Ubuntu Server

  

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.

As of PHP 7.1, the php-mcrypt was deprecated. And as of PHP 7.2 it was completely removed. This is a problem, since a number of server software titles still depend upon this encryption tool. And because software like Nextcloud, ownCloud, and many more have yet to shift that dependency, you might find yourself unable to install without mcrypt on the system. What do you do? No matter how many times you run either apt-get install php-mcrypt or yum install php-mcrypt, it won't work.

More about cybersecurity

Fortunately, there's a solution. Said solution falls onto the shoulders of the pecl command. PECL is the PHP Extension Community Library, which serves as a repository for PHP extensions. Through this repository, you can install mcrypt.

How

Here’s how to install Apache2 with PHP support on Ubuntu 18.04 LTS. Oh, Ubuntu 18.04 LTS also comes with the latest version of PHP which is 7.1 If you’re going to be building any PHP based application, you’re mostly going to need PHP and related modules installed on your systems. How To Install WordPress On Ubuntu server. Sudo apt install php-curl php-gd php-mbstring php-mcrypt php-xml php-xmlrpc libapache2-mod-php7.0.

What is mcrypt?

How To Install Php Mcrypt On Ubuntu Server Tutorial

The mcrypt extension is a replacement for the UNIX crypt command. These commands serve as a means to encrypt files on UNIX and Linux systems. The php-mcrypt extension serves as an interface between PHP and mcrypt.

SEE: Securing Linux policy (Tech Pro Research)

Getting mcrypt installed

I'm going to walk you through the process of getting mcrypt installed on Ubuntu Server 16.04. It's not challenging once you have the necessary dependencies added to your system. With mcrypt installed, you can continue with the installation of the software that depends upon this extension.

With that said, how do we install mcrypt? First, open up a terminal window and install the necessary dependencies with the commands:

Once the dependencies have been installed, you can install mcrypt with the command:

How To Install Php Mcrypt On Ubuntu Server Gui

Install

And there you go. Mcrypt is now installed. Go back to the process of installing whatever server software that depends upon this extension and you should be good to go.

Not gone, just moved

Don't worry: mcrypt is not gone. It's just been moved out of PHP and into PECL. But for those who have been installing via php-mcrypt for years, this makes for a pretty big shift. Now, instead of being able to install mcrypt with a single command, you have four to deal with. Even so, at least you still have mcrypt available. Eventually, however, I believe the mcrypt dependency will be migrated to another tool (such as OpenSSL).

Cybersecurity Insider Newsletter

Strengthen your organization's IT security defenses by keeping abreast of the latest cybersecurity news, solutions, and best practices. Delivered Tuesdays and Thursdays

Sign up today Sign up today

Also read...

How To Install Php Linux

How
  • How to install ownCloud on Ubuntu 18.04 (TechRepublic)
  • How to install nextCloud 13 on Ubuntu 18.04 (TechRepublic)
  • How to install Ubuntu Server 18.04 (TechRepublic)
  • How to encrypt files on a Ubuntu server with Tomb (TechRepublic)
  • Open source's big German win: 300,000 users shift to Nextcloud for file sharing (ZDNet)