How To Enable Php Mcrypt on Mac Os X Lion 10.7.4

你离开我真会死。 提交于 2019-12-11 10:52:41

问题


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.


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/12019330/how-to-enable-php-mcrypt-on-mac-os-x-lion-10-7-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!