• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to install mcrypt on PHP 5.4?

#1
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.
Do the one thing you think you cannot do. Fail at it. Try again. Do better the second time. The only people who never tumble are those who never mount the high wire.
Reply

#2
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.
Reply

#3
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.
Reply

#4
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!
Do the one thing you think you cannot do. Fail at it. Try again. Do better the second time. The only people who never tumble are those who never mount the high wire.
Reply

#5
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.
Reply

#6
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.
Reply

#7
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.
Do the one thing you think you cannot do. Fail at it. Try again. Do better the second time. The only people who never tumble are those who never mount the high wire.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.