Download and install MacPorts from http://macports.org.
The following steps are performed in the Terminal:
Force MacPorts to update:
sudo port -v selfupdateNow, install memcached:
sudo port install memcachedSet memcached to load on startup:
sudo port load memcachedInstall the PHP5 module for memcache:
sudo port install php5-memcacheCopy the newly created shared object for memcache into Mac OS X’s default PHP5 extension directory:
sudo cp /opt/local/lib/php/extensions/no-debug-non-zts-20090626/memcache.so /usr/lib/php/extensions/no-debug-non-zts-20090626/Install APC (Alternative PHP Cache):
sudo port install php5-apcCopy the newly created shared object for APC into Mac OS X’s default PHP5 extension directory:
sudo cp /opt/local/lib/php/extensions/no-debug-non-zts-20090626/apc.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=memcache.so
extension=apc.soAnd finally, restart Apache:
sudo apachectl restartTo confirm installation, create a new PHP document called phpinfo.php with the following contents:
< ?php phpinfo(); ?>Point your browser to that file. If all went well, you’ll see these blocks: from http://www.gigoblog.com/2011/01/23/install_memcache_and_apc_on_mac_os_x_server/
No comments:
Post a Comment