Myoddweb.com
There are many sites around explaining how to install MCrypt for windows but none seem very straight forward.
I have PHP installed on a windows development machine and I need MCrypt installed.
The default installation might not have mcrypt or you might have missed it shomehow…
If that happens all you need to do it
- Go to the php download website and download the windows binary package, (not the installer).
- Unzip the file in a folder, (it should create a folder called something like php-5.x.yy-Win32, depending on the version number of php you got.
- In that folder there should be a file called “libmcrypt.dll”, copy the file to your php extension folder, (see below if you don’t know where that is).
- In that folder there should also be another folder called “ext”, open it and copy the file “php_mcrypt.dll” to your php extension folder.
- edit your php.ini file, (see below if you don’t know where that is), and add the line:
…
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
…
extension=php_mcrypt.dll
…
Look for other “ extension=… ” to find where to add this line. - Restart your web server, with Apache for example click on the icon on the task bar and select ‘restart’.
Where are my php extensions?
Normally they are located in your program files directory, something like “C:\Program Files\PHP\“, if you are using a non english version of Windows then the name might be different.
If it is not there then create a phpinfo.php test file and look for the path in the various variables, (look for the variables extension_dir as well as PHPRC).
Where is my php.ini file?
Same as above, normally they are located in your program files directory, something like “C:\Program Files\PHP\“, if you are using a non english version of Windows then the name might be different.
If it is not there then create a phpinfo.php test file and look for the path in the various variables, (look for the value “Loaded Configuration File“ ).
What should my phpinfo.php file look like?
Open a blank file with your favourite text editor and type.
Save the file as phpinfo.php in your web folder and it should show you all the information you need about your php installation.
Как установить MCrypt для PHP 7.x
Расширение MCrypt предназначено для шифрования/дешифрования данных. Оно было признано устаревшим и в итоге, начиная с версии PHP 7.2 его убрали из ядра php. Однако, могут возникнуть ситуации, когда это расширение может понадобится, когда, например, вы работаете с какой-то устаревшей cms или просто старой программой и нет времени или желания переделывать программу.
Расширение MCrypt было перенесено в PECL по адресу https://pecl.php.net/package/mcrypt. На момент написания статьи последняя версия 1.0.3, которая поддерживает PHP 7.2, PHP 7.3 и PHP 7.4, а так же обещает поддержку PHP 8, который пока еще не вышел.
Как установить MCrypt для PHP 7.2, 7.3, 7.4 для Linux
Необходимо выполнить обновление репозитария и затем установить расширение:
$ sudo pecl channel-update pecl.php.net $ sudo pecl install mcrypt-1.0.3
sudo apt-get -y install gcc make autoconf libc-dev pkg-config sudo apt-get -y install libmcrypt-dev sudo pecl install mcrypt-1.0.3
После установки найдите куда установился файл mcrypt.so. Скорее всего это /usr/lib/php/modules/mcrypt.so или /usr/lib64/php/modules/mcrypt.so
Затем нужно найти php.ini. Не могу указать точный путь, т.к. на разных системах это могут быть абсолютно разные места, например, /etc/php.ini, либо /etc/php/7.2/cli/php.ini или /opt/php72/etc и др. Так же, php.ini может быть в папке пользователя.
В php.ini найдите где добавляются другие расширения (строки начинающиеся «extension margin-top:1em;»>Как установить MCrypt для PHP 7.2, 7.3, 7.4 для Windows
Скачайте архив расширения со страницы PECL https://pecl.php.net/package/mcrypt/1.0.3/windows для нужной версии PHP. Если не уверены, какая именно версия Thread Safe (TS) x86, Non Thread Safe (NTS) x86 или тоже x64 нужна, скачайте все четыре версии. Потом просто попробуете каждую из них и какая заработает, ту и оставите.
В скачанном архиве вам нужен файл php_mcrypt.dll — его нужно распаковать в папку, где установлен ваш PHP в подкаталог ext, где находятся и все другие расширения.
В php.ini найдите где добавляются другие расширения (строки начинающиеся «extension » src=»https://codernotes.ru/images/1572757006_install_mcrypt.JPG» style=»width:100%;max-width:995px;»/>
На этом установка MCrypt для PHP 7.2, 7.3, 7.4 завершена.
Installing/Configuring
# 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
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.
For PHP-7 UNIX Server use this
sudo apt-get install mcrypt php7.0-mcrypt
sudo service apache2 restart
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
On ubuntu 8 (hardy), the mcrypt library seems to be here.
So I just created mcrypt.ini in /etc/php5/conf.d and added this one liner.
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() .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 php\ext directory.
Resolved my problem on Ubuntu 14.04:
$sudo apt-get install php5-mcrypt
$sudo php5enmod mcrypt
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
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:\wamp\bin\php\PHP52~1.8
to C:\WINDOWS\system32 . This did not work on it’s own. I found other advice as follows and now mcrypt is working.
Go to F:\wamp\bin\php\PHP52~1.8\php.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:\wamp\bin\php\PHP52~1.8\phpForApache.ini
F:\wamp\bin\apache\APACHE~1.11\bin\php.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:
With this done, the dynamic extension will load up just fine.
php_mcrypt.dll
Here is complete guide of php_mcrypt.dll installation. Read it below and you will know where to put php_mcrypt.dll.
Step one. Unzip php_mcrypt.dll wherever you want.
Step two. Place php_mcrypt.dll in \Windows\System32 (usually located at disk C) if you’re running 32 bit Windows. If you’are running 64 bit Windows, additionally place file in \Windows\SysWOW64.
Look at the System Type and what is listed next.
- If you running 32-bit Operating System of Windows 7/8/8.1 you have this:
- If you running 64-bit Operating System of Windows 7/8/8.1 you have this:
Step three. Reboot your pc.
If after rebooting you still getting php_mcrypt.dll error, do the following:
- Press ‘Start‘
- Type ‘cmd‘ in search and press Enter.
- Type regsvr32 php_mcrypt.dll and press Enter
After doing this restart your PC again and you will be no longer receiving php_mcrypt.dll errors.
Incoming Search Terms:
- php_mcrypt.dll is missing from your computer
- descargar php_mcrypt.dll
- php_mcrypt.dll ppsspp
- php_mcrypt.dll fehlt
- baixar php_mcrypt.dll
- instalar php_mcrypt.dll
- php_mcrypt.dll download
- php_mcrypt.dll скачать
- php_mcrypt.dll indir
- php_mcrypt.dll erro
- php_mcrypt.dll was not found
- telecharger php_mcrypt.dll
- php_mcrypt.dll hatası
- php_mcrypt.dll manquant
- php_mcrypt.dll hatası
- php_mcrypt.dll letöltés
- php_mcrypt.dll hiányzik
A bit more about php_mcrypt.dll…
php_mcrypt.dll it is dynamic link library that is a part of Microsoft Visual C++ component. It is used by many modern games and programs: pes 2016,Gta 5, far cry 4, Sims 4, Arma 3, Battlefield 4,Watch Dogs,Pes 2013 Dragon Age: Inquisition and many more.
Usually php_mcrypt.dll located at Windows\System32 if you are running Windows 32 bit. If you are running Windows 64 bit (doesn’t matter which one – XP, Vista, Seven or 8) copy of this file also located at Windows\SysWOW64.
If php_mcrypt.dll is missing in one or both directories, program or game that uses this file cannot find it and cannot receive required data, so you get error like that:
The program can’t start because php_mcrypt.dll is missing from your computer. Try reinstalling the program to fix this problem.
Of course, you don’t need to reinstall game or program. You just need to download php_mcrypt.dll and install it properly to fix this error.