Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php 7 Mcrypt PHP extension required [duplicate]

Tags:

hello guys l have installed php7 from this link and this link too.

but when i try to run a Laravel based project there is an error coming up as follows

Mcrypt PHP extension required.

I tried to locate mcrypt.so and change the path in mycrpt.ini but i still get the same error i only get this error i Laravel projects

like image 947
Ali Bedaer Avatar asked Apr 04 '16 11:04

Ali Bedaer


People also ask

How do I fix mcrypt PHP extension?

Edited: First you should use command cd /Applications/MAMP/bin/php to check which PHP version from MAMP you are using and then replace with the PHP version above. Then restart the terminal to see which PHP you are using now. And it should be working now.

What is mcrypt PHP extension?

The mcrypt extension is an interface to the mcrypt cryptography library. This extension is useful for allowing PHP code using mcrypt to run on PHP 7.2+. The mcrypt extension is included in PHP 5.4 through PHP 7.1.

What replaces PHP mcrypt?

As mentioned above, open_ssl is a good alternative for mcrypt.

Is PHP mcrypt deprecated?

The mcrypt extension has been abandonware for nearly a decade now, and was also fairly complex to use. It has therefore been deprecated in favour of OpenSSL, where it will be removed from the core and into PECL in PHP 7.2.


2 Answers

Had the same issue - PHP7 missing mcrypt.

This worked for me in Ubuntu Please try below commands.

sudo apt-get update
sudo apt-get install mcrypt php7.0-mcrypt
sudo apt-get upgrade

Then restarts apache

sudo service apache2 restart

Hope this commands helps!

like image 65
Ankit Sompura Avatar answered Sep 28 '22 21:09

Ankit Sompura


First Check whether the mcrypt PHP module is present:

$ php -m | grep mcrypt

To install the mcrypt PHP module we first need to satisfy the following prerequisites:

sudo apt install php-dev libmcrypt-dev php-pear

Now we are ready to install mcrypt PHP module on our Ubuntu 18.04 system:

$ sudo pecl channel-update pecl.php.net
$ sudo pecl install mcrypt-1.0.1

Open the /etc/php/7.2/cli/php.ini file and insert:

extension=mcrypt.so

All done. When successful, checking for the presence of the mcrypt PHP module should produce the following output:

$ php -m | grep mcrypt
mcrypt

Then restarts apache

sudo service apache2 restart
like image 44
PHP Worm... Avatar answered Sep 28 '22 21:09

PHP Worm...