Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
$ which mcrypt
$ mcrypt -v
Mcrypt v.0.9.9 (i386-apple-darwin10.4.0)
Linked against libmcrypt v.2.5.8
Copyright (C) 1998-2002 Nikos Mavroyanopoulos (

So I have mcrypt. How do I get PHP to use it? Other than adding

to php.ini, I also see this in php.ini

; For more information about mcrypt settings see

; Directory where to load mcrypt algorithms
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)

; Directory where to load mcrypt modes
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)

which is obviously unused.

How can I get mcrypt working for PHP?

This install is on Mac OS X 10.6, using MacPorts. I would prefer not to have to recompile php if possible.

share|improve this question
Have you tried installing php5-mcrypt from MacPorts as well? (sudo port install php5-mcyrpt) – Chealion Aug 26 '10 at 23:34
You have a little error in the command, I noticed it when I copy-pasted in my terminal: sudo port install php5-mcrypt – tXK Feb 26 '12 at 12:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.