Memcache cache is a good software, here is the method of installing under Linux:
The server side mainly installs memcache server, the latest version is memcached- 1.3.0. Download: http://www.danga.com/memcached/dist/memcached-1.2.2.tar.gz In addition, Memcache uses the library libevent for Socket processing, so you need to install libevent, the latest version of libevent is Libevent-1.3. (If your system has libevent installed, you don't need to install it): http://www.monkey.org/~provos/libevent/Download: http://www.monkey.org/~provos/libevent-1.3. Tar.gz
Download these two things directly with the wget command. After downloading the source file. 1. Install libevent first. This thing needs to specify an installation path when configuring, ie ./configure –prefix=/usr; then make; then make install; 2. install memcached, just need to specify the installation path of libevent in configuration. /configure –with-libevent=/usr; Then make; then make install; this completes the installation of the Memcache server under Linux. The detailed method is as follows:
1. Download memcached and libevent respectively and put them in the /tmp directory: # cd /tmp# wget http://www.danga.com/memcached/dist/memcached- 1.2.0.tar.gz# wget http://www.monkey.org/~provos/libevent-1.2.tar.gz
2. Install libevent:# tar zxvf libevent-1.2.tar. Gz# cd libevent-1.2# ./configure –prefix=/usr# make# make install
3.Test if libevent is installed successfully: # ls -al /usr/lib |
Grep libeventlrwxrwxrwx 1 root root 21 11?? 12 17:38 libevent-1.2.so.1 -> libevent-1.2.so.1.0.3-rwxr-xr-x 1 root root 263546 11?? 12 17:38 libevent -1.2.so.1.0.3-rw-r–r– 1 root root 454156 11?? 12 17:38 libevent.a-rwxr-xr-x 1 root root 811 11?? 12 17:38 libevent.lalrwxrwxrwx 1 Root root 21 11?? 12 17:38 libevent.so -> libevent-1.2.so.1.0.3 is not bad, they are installed.
4. Install memcached, and also specify the installation location of libevent in the installation: # cd /tmp# tar zxvf memcached-1.2.0.tar.gz# cd memcached-1.2.0# ./configure – With-libevent=/usr# make# make install If an error occurs in the middle, please check the error message carefully and configure or add the corresponding library or path according to the error message. After the installation is complete, put memcached in /usr/local/bin/memcached,
5. Test whether the memcached is successfully installed: # ls -al /usr/local/bin/mem*-rwxr-xr-x 1 root root 137986 11?? 12 17:39 /usr/local/bin/memcached-rwxr-xr-x 1 root root 140179 11?? 12 17:39 /usr/local/bin/memcached-debug
Install Memcache's PHP
extension 1. Select the version of memcache you want to download at http://pecl.php.net/package/memcache. 2. Install PHP's memcache extension
tar vxzf memcache-2.2.1.tgzcd memcache-2.2.1/usr/local/php/bin/phpize./configure –enable-memcache –with-php -config=/usr/local/php/bin/php-config –with-zlib-dirmakemake install
3. After the above installation, there will be a prompt like this:
Installing shared Extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-2007xxxx/
4.Modify extension_dir = “./” in php.ini to < Br>
extension_dir = “/usr/local/php/lib/php/extensions/no-debug-non-zts-2007xxxx/”
5. Add a line to load the memcache extension: Extension=memcache.somemcached basic settings:
1. Start Memcache server: # /usr/local/bin/memcached -d -m 10 -u root -l 192.168.0.200 -p 12000 -c 256 -P /tmp/memcached.pid
-d option is to start a daemon, -m is the amount of memory allocated to Memcache, the unit is MB, I am 10MB here, -u is running Memcache User, I am root here, -l is the server IP address of the listener, if there is more Address, I specified the server's IP address 192.168.0.200, -p is the port to set Memcache listening, I set here 12000, preferably more than 1024 port, -c option is the maximum number of concurrent connections running, The default is 1024, I set 256 here, according to the load of your server, -P is the pid file to save Memcache, I saved it here at /tmp/memcached.pid,
2. If you want to end the Memcache process, execute:
# kill `cat /tmp/memcached.pid`
You can also start multiple daemons, but the ports cannot be duplicated.
3. Restart apache, service httpd restart
Memcache environment test: Run the following php file, if there is output This is a test!, it means the environment is built successfully. Start to appreciate the charm of Memcache! < ?php$mem = new Memcache;$mem->connect(”127.0.0.1″, 11211);$mem->set(’key’, ‘This is a test!& rsquo;, 0, 60); $val = $mem->get(’key’);echo $val;?>
What is the boot process for Linux? How to complete the system startup through grub boot? These pro
The repo file is the configuration file of the yum source (software repository) in Fedora. Usually a
The role of a .linux device driver Kernel: used to manage hardware and software resources, and pro
You all know what an IP address is, right? They are assigned to devices on the network to represent
Find Out Server CPU Architecture(32 bit or 64 bit) in Linux
Sogou Pinyin input method under Linux: ibus-cloud-pinyin
How does the Linux system change face Win8 Linux system Win8 skin
Linux system administrator's work experience sharing
How to install the graphics card driver under Linux Step
Git did not exit cleanly (exit code 128) solution
Simple steps to configure NFS under Linux
Commonly used shortcut keys in the Linux command line
Ssh certificate authentication landing implementation tutorial
Win7 sound card driver normal computer no sound how to do
Win7 system deletes the file when the file is too large to be put into the recycle bin how to do
Solve the problem that win 8 browser can't open QQ space
How to make Linux support ASP/ASP.NET diagram detailed tutorial
How to prevent Win7 system from automatically upgrading to IE11 browser
Win10 Mobile/PC version MSN series universal application updated
Let Win 8 automatically shut down and cancel automatic shutdown
Win7 start menu can not find all program options how to fix
Virtualbox installation win10 appears flower screen how to do