How do I install mcrypt? I'm using Leopard 10.5.8 with PHP5.
3 Answers
Ok, I just spent 1.5 hours trying to do this myself on 10.6.7
I believe the solution was this:
I installed php5-mcrypt + universal
with macports:
$ sudo macports php5-mcrypt +universal
then, you can't just put extension=mycrypt.so
in the php.ini
file, you have to put the direct path i.e.:
extension = /opt/local/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so
you see, PHP looks in /usr/local/lib/php/extensions/no-debug-non-zts-20090626/
which is the difference I missed!!
Then just restart apache with your
$ sudo apachectl -k graceful
and then
$ php -m | grep mcrypt
to make sure it's there.
Hope this helps someone!

- 91
- 1
- 3
-
Thanks so much! I was pulling my hair out on this. – Jeffrey Sweeney Nov 12 '12 at 15:25
# Edit macports.conf
cd /opt/local/etc/macports
sudo nano macports.conf
# Change the line ....
universal_archs ppc i386
# to ...
universal_archs ppc ppc64 i386 x86_64
# Get the MCRYPT Library
sudo port install mcrypt +universal
Source: This page.

- 57,028
- 9
- 76
- 100
-
Follow the instructions; checking info.php -- no mcrypt. Ideas? – Tomer Lichtash Sep 19 '09 at 16:52
-
1
-
In which stage? I'm not quite sure. If you'd tell me which command to run, it'll be very helpful. – Tomer Lichtash Sep 19 '09 at 17:25
-
Well if you look at the linked page, below "Build and Install PHP". Commands to run are the lines in the orange box, not starting with hashmarks. – Zed Sep 19 '09 at 17:43
-
Error: Target org.macports.extract returned: shell command failed (see log for details) – malhal Aug 11 '14 at 13:56
It depends on how you've installed PHP.
If you installed PHP via macports, you can:
sudo port install php5-mcrypt +universal
If you custom-compiled your PHP, it's probably easiest to just recompile with:
--with-mcrypt=/path/to/mcrypt
(Not sure where macports actually keeps it, since I don't use macports, but just compile my AMP stack (and most dependencies) from source)
-
I tried running 'sudo port install php5-mcrypt +universal" and got this:
Skipping org.macports.activate (mcrypt +universal) since this port is already active
But info.php shows nothing, and phpMyAdmin still claims mcrypt is nowhere around its sight. – Tomer Lichtash Sep 19 '09 at 17:23