25

how to install mcrypt in xampp on windows?

My PHP Version 7.0.5 and xampp pack have not mcrypt extension so how can i install mcrypt on xampp ?

Dhaval Koradiya
  • 424
  • 1
  • 6
  • 11
  • 1
    Did you try : http://www.myoddweb.com/2010/11/18/install-mcrypt-for-php-on-windows/ – Niklesh Raut May 30 '16 at 09:44
  • @Rishi i had exactly the same post in my Copy'N' Paste :) – KikiTheOne May 30 '16 at 09:45
  • 90% we found the same solution, Only if we want to search. I think Dhaval not tried this. – Niklesh Raut May 30 '16 at 09:48
  • i tried every solution. @Rishi yes is seen this link. do you found “php_mcrypt.dll” file in php7 package ? – Dhaval Koradiya May 30 '16 at 09:55
  • It is best not to use mcrypt, it is abandonware, has not been updated in years and does not support standard PKCS#7 (née PKCS#5) padding, only non-standard null padding that can't even be used with binary data. mcrypt has many outstanding [bugs](https://sourceforge.net/p/mcrypt/bugs/) dating back to 2003. The mcrypt-extension is deprecated will be removed in PHP 7.2. Instead consider using [defuse](https://github.com/defuse/php-encryption) or [RNCryptor](https://github.com/RNCryptor), they provide a complete solution and are being maintained and is correct. – zaph Sep 04 '17 at 20:41
  • Tried the same link for 7.0.3,7.2 but it did not worked out. How to replace mcrypt for ongoing project – insoftservice Apr 16 '19 at 11:16

5 Answers5

42

First, you should download the suitable version for your system from here: https://pecl.php.net/package/mcrypt/1.0.3/windows

Then, you should copy php_mcrypt.dll to ../xampp/php/ext/ and enable the extension by adding extension=mcrypt to your xampp/php/php.ini file.

Axel Köhler
  • 911
  • 1
  • 8
  • 34
mrdev
  • 617
  • 7
  • 8
6

The recent versions of XAMPP for Windows runs PHP 7.x which are NOT compatible with mbcrypt. If you have a package like Laravel that requires mbcrypt, you will need to install an older version of XAMPP. OR, you can run XAMPP with multiple versions of PHP by downloading a PHP package from Windows.PHP.net, installing it in your XAMPP folder, and configuring php.ini and httpd.conf to use the correct version of PHP for your site.

DigitCart
  • 2,980
  • 2
  • 18
  • 28
MrMoxy
  • 392
  • 4
  • 13
2

you should install mcrypt with pecl on your xampp server:

./bin/pecl install mcrypt

then add to php.ini this code (extension block):

extension=mcrypt.so 
  • thank you! Most answers were telling me to use `apt`, but that would install the mcrypt along with php 8.x which I didn't want. This did the trick perfectly. I also had to `apt install libmcrypt-dev` for pecl to compile this btw. – Harshil Mehta Aug 22 '23 at 11:47
0

Do not provide a version number when you run the command:

composer create-project laravel/laravel your-project-name 4.2.*

Use this instead:

composer create-project laravel/laravel example-app
ugexe
  • 5,297
  • 1
  • 28
  • 49
-3

Right from the PHP Docs: PHP 5.3 Windows binaries uses the static version of the MCrypt library, no DLL are needed.

http://php.net/manual/en/mcrypt.requirements.php

But if you really want to download it, just go to the mcrypt sourceforge page

http://sourceforge.net/projects/mcrypt/files/?source=navbar

  • 1
    This standard answer that seems to show up everywhere is not valid here, since the asker made it clear he is using PHP 7.0.5. – Matheus Rocha Dec 17 '19 at 23:59