I found out that when I wanted to use phpmyadmin, it asked for the libmcrypt module. So here is how I added mcrypt to PHP:
First download the libmcrypt sourcecode (I’ve used version 2.5.8).
First you need to unpack the source code and decide if you need the 32 bits or 64 bits version (of your apache/php installation).
for 64 bits use:
CXXFLAGS="-arch x86_64" \
./configure --disable-posix-threads
for 32 bits use:
For all versions use:
To compile and:
To install the library.
Next step is to recompile the php installation as described on these two pages:
Compiling PHP in 32 bits mode on Leopard
Compiling PHP in 64 bits mode on Leopard
The only change you need to make is to add:
To the configure statement and it will include this library for you.
For example:
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/etc \
--with-zlib \
--with-zlib-dir=/usr \
--with-openssl \
--enable-exif \
--enable-ftp \
--enable-mbstring \
--enable-mbregex \
--enable-sockets \
--with-mcrypt \
--with-mysql=/usr/local/mysql \
--with-pdo-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-apxs2=/usr/local/apache2/bin/apxs



11:31 pm
Works like a charm thx
12:29 pm
thanks man. i got a mysql error when compiling with 32-bit mode. Haha, didn’t realize which version i had. But it works with 64-bit mode.
Also, I have OSX 10.5(.7) using the default apache install. I had to change that last line for “apxs2″ to:
[code]--with-apxs2=/etc/apache2/bin/apxs[/code]
because apache lives at /etc/apache2 (aka /private/etc/apache2)
Thanks again!!
12:54 pm
Oops, another little quirk…on my system, I had to change the “–prefix=” to “/etc”. That’s where php lives for me.
8:10 pm
@OSXniCKels, Thanks for mentioning this. Although most of your remarks have been answered in other sections of this site.
10:40 pm
#
15 Mar 2009
12:46 am
I
5:06 am
Great site … thanks for sharing your experience …
I installed the newest versions of MySQL, Apache and PHP according your instructions … everything worked fine … then I doubled back to enable mcrypt … and here’s the problem I’ve run during the PHP make …
—
Generating phar.php
dyld: Symbol not found: _arcfour_LTX__is_block_algorithm
Referenced from: /usr/local/lib/libmcrypt.4.dylib
Expected in: flat namespace
/bin/sh: line 1: 40287 Trace/BPT trap ` if test -x “/Users/anon/Downloads/php-5.3.0/sapi/cli/php”; then /Users/anon/Downloads/php-5.3.0/build/shtool echo -n — “/Users/anon/Downloads/php-5.3.0/sapi/cli/php -n”; if test “x” != “x”; then /Users/anon/Downloads/php-5.3.0/build/shtool echo -n — ” -d extension_dir=/Users/anon/Downloads/php-5.3.0/modules”; for i in bz2 zlib phar; do if test -f “/Users/anon/Downloads/php-5.3.0/modules/$i.la”; then . /Users/anon/Downloads/php-5.3.0/modules/$i.la; /Users/anon/Downloads/php-5.3.0/build/shtool echo -n — ” -d extension=$dlname”; fi; done; fi; else /Users/anon/Downloads/php-5.3.0/build/shtool echo -n — “”; fi;` -d ‘open_basedir=’ -d ‘output_buffering=0′ -d ‘memory_limit=-1′ -d phar.readonly=0 -d ’safe_mode=0′ /Users/anon/Downloads/php-5.3.0/ext/phar/build_precommand.php > ext/phar/phar.php
make: *** [ext/phar/phar.php] Error 133
—
Any ideas … ?
7:17 am
Hi Anonymous, it could be caused by a miriad of problems. But try to compile mcrypt again and then compile php again. Make sure both are either 32 or 64 bits compilations. If it still does not work mail me at info @ this domain.
4:12 pm
Seemed to install fine except I saw this at the end “checking for C++ compiler default output file name… configure: error: C++ compiler cannot create executables” and I’m not sure if that is a problem or not? Doesn’t sound right…
4:52 pm
I reinstalled xtools and reinstalled libmcrypt and that seemed to fix the C++ compiler issue.