Mcrypt is not loading in php

Hi,

I am trying to use decrypt and encrypt in php 5.2 (in windows).
I checked the ext directory and system 32 and they are both missing the php_mcrypt and lib_mcryot. Which one do I need to get the encrypt /decrypt going ? Can somebody send me the links or dll files? How am i supposed to install them  ? I found one but as soon as i include the extension to my php.ini, the whole thing crashes.

Thanks,
Raz
ucsdmbdmAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rdivilbissCommented:
The mcrypt extensions have not been updated for quite some time.  You'll probably be able to find them in a early 5.2.x .zip download at php.net.
0
rdivilbissCommented:
I just downloaded php-5.2.13-Win32.zip and the mcrypt extensions are in that package.  They don't seem to be in the other download packages any more.  I am told by my ISP they are unstable, yet I did talk them into loading them for one of my sites.

Another ISP I use refuses to support mcrypt on their servers.
0
ucsdmbdmAuthor Commented:
Hi all,
Does anyone recommend any other solution for decrypting and encrypting ?


Thank You,

Ross
0
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

rdivilbissCommented:
>anyone, probably means anyone but me, but mcrypt will work.  You just have to have the correct entries in php.ini and copy the mcrypt libraries into your PHP/ext directory.

I'm using php_mcrypt.dll dated 9/16/2009 on a PHP 5.2 build 3790.

php.ini has:

extension=php_mcrypt.dll

That's all it takes. Obviously the php_mcrypt in 5.2.13 dated 2-24-2010 is apparently newer and may have improvements.

All you need is the dll file in your ext directory and one line in php.ini.
0
ucsdmbdmAuthor Commented:
Hi,

I can't find it. Would you please upload it here. I tried my own php_mcrypt.dll and as soon as I added that line to the end of my php,ini, the php crashes. My php.ini doesn't even have that line so I added that line at the very end of php.ini.  

Thanks,
Ross
0
ucsdmbdmAuthor Commented:
Hi
I got the dll from the zip package but as soon as I uncomment the last line. PHP will not come up at all.

extension=php_xmlrpc.dll
[PHP_EXIF]
extension=php_exif.dll
[PHP_MCRYPT]
;extension=php_mcrypt.dll

I added the php_mcrypt.dll to both php/ext and system32 folders

Thanks,
Ross
0
SwafnilCommented:
Could you set your php.ini settings "error_log" to "syslog" and "display_startup_errors" to "on"? The next time you'll start your webserver, you'll get an error message telling you what's wrong with your php setup, further information will most likely be added to your event log.

I had problems loading mcrypt with Zend Server CE and ended up moving libmcrypt.dll to my system32 directory because PHP didn't know where to look for the DLL.
0
ucsdmbdmAuthor Commented:
Hi Swafnil,

I changed error_log to system_log and also changed that display_startup_error to  on & restarted the server but can't find the events log.
0
SwafnilCommented:
it should be error_log = syslog, not system_log, I don't know where (or even if) errors will be logged when you use system_log.

Did you copy the file libmcrypt.dll from the php root directory into some directory defined in the Windows environment variable PATH? What happens if you type "libmcrypt.dll" on the Windows "Run ..." prompt and hit enter? Do you get a "the system does not know how to open this file" or a "file not found" message?
0
rdivilbissCommented:
Just to avoid confusion, in the later distributions it is php_mcrypt.dll not libmcrypt.dll.
0
SwafnilCommented:
@rdivilbiss: no, you will need both files, libmcrypt.dll as the core component and php_mcrypt.dll as wrapper for libmcrypt.dll:

http://php.net/manual/en/install.windows.extensions.php
http://www.php.net/manual/en/mcrypt.requirements.php
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SwafnilCommented:
Just in case you mixed files from different ZIP files, another thing now possibly causing problems: you can't mix different PHP version's extensions so using php_mcrypt.dll from 5.2.13 with a PHP core version 5.2.12 will cause startup errors if the extension is loaded.
0
ucsdmbdmAuthor Commented:
Thanks Swafnil:,

I will restart the server tonight and will let you know about the logs.

0
rdivilbissCommented:
@Swafnil, thanks for the info. Glad you are able to assist ucsdmbdm with the problem.
0
SwafnilCommented:
@ucsdmbdm: How's your progress? Is mcrypt being loaded successfully?

@rdivilbiss: You are welcome, It's always a pleasure to help find solutions!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.