1

I have been trying to enable mcrypt for two days in OS X. I read lots of document but I could not accomplish. Maybe it is because I am new in OS X environment.

The brief summary what I have done so far is;

I installed Xcode and installed Command Line Tools.

Downloaded and extracted libmcrypt-2.5.8 and php-5.3.15.

cd libmcrypt-2.5.8
./configure && make && sudo make install

The output of this is

Libraries have been installed in:
/usr/local/lib 

and some other logs like

make[2]: Nothing to be done for `install-exec-am'.

The next step is;

cd php-5.3.15/ext/mcrypt
./configure && make && sudo make install

The output of this is

Installing shared extensions:
/usr/lib/php/extensions/no-debug-non-zts-20090626/

According to documents that I read, this means the installation is successful. After all these I opened /etc/php.ini and wrote extension=mcrypt.so. I restarted apache with sudo apachectl restart. But nothing happened. Mcrypt did not appear in php -m.

I also tried to install mcrypt with sudo port install php-mcrypt +universal but also this did not worked.

I saw another topic which is related to this problem and there was an answer which says that changing extension=mcrypt.so with full path of mcrypt.so. I tried and that is also not worked for me.

Kuf
  • 17,318
  • 6
  • 67
  • 91
udogan
  • 11
  • 1
  • 4

2 Answers2

1

I found this walkthrough useful, http://www.coolestguyplanettech.com/how-to-install-mcrypt-for-php-on-mac-osx-lion-10-7-development-server/

Kris Chant
  • 279
  • 2
  • 7
  • thanks. that tutorial worked for me, except it gives me an error "error: 'PHP_FE_END' undeclared here" at first.. Found another strange solution, had to edit ext/mcrypt/mcrypt.c, replace PHP_FE_END with {NULL,NULL,NULL}. that's it. – thinzar00 Jul 04 '13 at 08:43
0

Make sure 'extension_dir' property is set in your php.ini or if its already there check that its not commented.

bpatel
  • 381
  • 1
  • 4
  • I also tried it but it did not work either. Above of extension=mcrypt.so i wrote extension_dir (not commented) and its path was the folder which has mcrypt.so. I again restarted apache but it did not worked. – udogan Aug 18 '12 at 15:51