Installing memcached on your Mac is similar to installing memcached on a Linux platform.
The main need to do two pieces:
I. Installation of Libevent library;
Two. Install memcached;
I. Installing the Libevent Library
Libevent is a library that encapsulates event-handling functions such as Linux's Epoll, BSD-class operating system kqueue, and so on as a unified interface. The Performance of O (1) can be played even if the number of connections to the server increases. Memcached uses this libevent library, so it can perform its high performance on Linux, BSD, Solaris and other operating systems. About event handling is no longer detailed here, you can refer to Dan Kegel's c10k problem.
Step 1: Download Libevent library, website address http://libevent.org/, I downloaded the version for libevent-2.0.22-stable and downloaded the libevent-2.0.22-stable.tar.gz file stored in the local directory.
Step 2: Unzip the compressed file, using the command:
TAR-XZVF libevent-2.0.22-stable.tar.gz Step 3: Perform the configuration, execute the command:./configure--prefix=/usr/local/ libevent where prefix specifies the location to install the libevent, it is recommended to place it under a directory in the/usr/local directory. Step 4: Install the Libevent Library, execute the command make && do install, if the current user is not an administrator, you need to modify the command to: At this point libevent installed successfully, we continue to memcached the installation process. Two. Install the memcached installation memcached the pre-process is to install the libevent, the steps to install libevent have been described earlier, the following to see the installation of memcached steps. Step 1: Download memcached, official website: http://memcached.org/downloads, I downloaded the version used formemcached-1.4.22.tar.gz, after downloading into the download directory;Step 2: Unzip the compressed file and execute the command:TAR-ZXVF MEMCACHED-1.4.22.TAR.GZCD memcached-1.4.22Step 3: Perform the configuration and execute the command:./configure--prefix=/usr/local/memcached/memcached-1.4.22--with-libevent=/usr/local/libevent Where prefix is still the installation directory of the specified memcached, and the with-libevent parameter specifies the installation path of the libevent you previously installed, if you do not specify this parameter, you may be prompted with the following error:
If It ' s already installed, specify its path using--with-libevent=/dir/Step 4: Install the memcached command, execute the command:Make && make installSimilarly, if the current user does not have administrator rights, you need to performMake && sudo make installIt is recommended that you perform the latter command Step 5: Start memcached, execute the command:/usr/local/memcached/memcached-1.4.22/bin/memcached this time another error is reported:
Dyld:library not loaded:/usr/lib/libevent-2.0.5.dylib
Referenced from:/usr/local/memcached/memcached-1.4.22/bin/./memcached
reason:image not found trace/bpt Trap:5This requires that we go to the directory where you just installed libevent to copy the Libevent-2.0.5.dylib file to the/usr/lib directory, and execute the following directory: sudo cp libevent-2.0.5.dylib/usr/lib After copying the file, Start memcached again, and after startup execute the following command to see if it started successfully: Ps-ef | The results of grep ' memcached ' return are as follows: 501 24136 5144 0 12:05 am ttys000 0:00.01/USR/LOCAL/MEMCACHED/MEMCACHED-1.4.22/BIN/MEMCA Ched
501 24155 24150 0 12:06 am ttys002 0:00.00 grep memcached
The entire installation process is complete! Reference Document: http://blog.csdn.net/pwlazy/article/details/1542916http://kb.cnblogs.com/page/42731/
Install memcached steps on Mac (Linux)