CodeIgniter Forums
How to install mcrypt on PHP 5.4? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: How to install mcrypt on PHP 5.4? (/showthread.php?tid=61382)



How to install mcrypt on PHP 5.4? - lexxtoronto - 04-11-2015

I have a Windows XP machine that I have to use temporarily. The newest version of wamp I can install is wamp 2.4 which comes with PHP 5.4.

I downloaded an mcrypt zip file and it has files like mcrypt.exe, cygmcrypt-4.dll, cygwin1.dll etc. So I installed cygwin and ran mcrypt.exe it just asked me to enter a passphrase and that's it.

I found an mcrypt.dll but wamp complains saying that it was compiled with an API different from the API PHP was compiled with.

Im lost.


RE: How to install mcrypt on PHP 5.4? - silentium - 04-12-2015

It has been a while since I used WAMP server on Windows, but to my knowledge mcrypt is included with WAMP. Have you checked what phpinfo() says?

Found your thread in the WAMP forum as well and noticed you had the same answer there.

If it is not loaded. Have you checked the list of available module that you can load in WAMP. You get to it by right clicking the small icon in the bottom right corner, select PHP and then PHP extensions.


RE: How to install mcrypt on PHP 5.4? - CroNiX - 04-12-2015

If you installed a specific php version, you can't install a module from a different php version. So the mcrypt.dll you found somewhere on the net isn't from the same php version AND build as what you have installed.


RE: How to install mcrypt on PHP 5.4? - lexxtoronto - 04-12-2015

Hm, phpinfo says it is enabled. I never bothered checking phpinfo because I usually go to php.ini and check if it's there. How come it's not in php.ini but shows as enabled in phpinfo? Anyhoo, thank you!


RE: How to install mcrypt on PHP 5.4? - mwhitney - 04-13-2015

http://php.net/manual/en/mcrypt.requirements.php
Quote:PHP 5.3 Windows binaries uses the static version of the MCrypt library, no DLL are needed.

http://php.net/manual/en/mcrypt.configuration.php
Quote:mcrypt.algorithms_dir string

The directory that contains the algorithms. Defaults to the directories compiled within libmcrypt, which is typically /usr/local/lib/libmcrypt. See mcrypt_list_algorithms() for additional details.
mcrypt.modes_dir string

The directory that contains the modes. Defaults to the directories compiled within libmcrypt, which is typically /usr/local/lib/libmcrypt. See mcrypt_list_modes() for additional details.

In other words, since it's installed as a compile-time option, you don't need anything in php.ini for mcrypt to work unless you need to change the directories used by mcrypt.


RE: How to install mcrypt on PHP 5.4? - alkarim - 04-13-2015

Check phpinfo()

if disabled
To the php.ini file in the wamp/bin/php/phpX.Y.Z/ directory (X.Y.Z refers to the php version)
You will get
;extension=php_mcrypt.dll

remove ";" from the front.
Now restart apache.


RE: How to install mcrypt on PHP 5.4? - lexxtoronto - 04-18-2015

alkarim: I never bothered checking phpinfo, I always go to php.ini and uncomment an extension, the problem with mcrypt is that it is not in php.ini, but when I checked phpinfo it is there.