#本博客已迁移至 [www.0x520.com][1] [1]:http://www.0x520.com
Download and install MacPorts from http://macports.org.
The following steps are performed in the Terminal:
Force MacPorts to update (will only work if Apple's Xcode installed):
sudo port -v selfupdate
Now, install memcached:
sudo port install php5-mcrypt
Copy the newly created shared object for mcrypt into Mac OS X’s default PHP5 extension directory:
sudo cp /opt/local/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so /usr/lib/php/extensions/no-debug-non-zts-20090626/
Next, you need to edit php.ini to add the extensions. Find the phrase Dynamic Extensions, and add:
extension=mcrypt.so
And finally, restart Apache:
sudo apachectl restart