简体   繁体   中英

How to enable mcrypt in php on Mac OSX 10.9?

Since I want to start learning Laravel, I need to install mcrypt in php. I'm on Mac OSX 10.9 and I installed apache and php manually (no mamp or anything like it) so I followed this guide to install mcrypt. The whole procedure works as expected (no errors), but after restarting the server using sudo apachectl restart I have a look at the output of phpinfo(), and I can't find any mentioning of mcrypt.

Since I don't think I had any errors in the process of compiling and installing, I don't really know where to look for the mistake. Does anybody know what would be logical things to check for?

I have the same problem, on MAC OS X 10.9, no mcrypt library working. After some hours and many headaches (I'm not so skilled...) I found this guide, and finally get it working on my local machine: http://jenssegers.be/blog/49/installing-the-php-mcrypt-extension-on-osx-10-9-mavericks

The passage I missed were to go in the ext/mcrypt dir of a new php downloaded package and then type:

cd php-5.4.17/ext/mcrypt/ /usr/bin/phpize ./configure make sudo make install

Then add extension=mcrypt.so in my php.ini file.

That's it. Hope this helps!

By default mcrypt lib is not installed on Mac OSX 10.9. So you have to first install it. You can get it from sourcefroge.net . You also need php 5.4.17 source( check your php version first php -v ). You can get it from github . extract both folders and.

Install autoconf

brew install autoconf

Build and install mcrypt lib

cd libmcrypt-2.5.8
./configure
make
sudo make install

Build php extension

cd php-5.4.17/ext/mcrypt/
/usr/bin/phpize
./configure
make
sudo make install

Finally add extension to php.ini

extension=mcrypt.so

Restart apache sudo apachectl restart

For more detailed info you can check it

http://topicdesk.com/downloads/mcrypt/mcrypt-download

You can download mcrypt installer from here. It works for me!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM