Application of PHP memcached advanced Caching

Source: Internet
Author: User

One, Installation of memcached

1. Download the memcache Windows stable version, extract and put under a certain disk, such as in c:\memcached

2. Enter ' c:\memcached\memcached.exe-d install ' installation at terminal (also known as cmd Command interface)

3. Re-enter: ' c:\memcached\memcached.exe-d start ' start. Note: Later memcached will start automatically every time a service is powered on as windows. This way the server side is already installed.

4. Download Http://pecl4win.php.net/ext.php/php_memcache.dll, please find the corresponding PHP version of the file

5. Join a line of ' Extension=php_memcache.dll ' in C:\winnt\php.ini

6. Restart Apache, and then look at the phpinfo, if there is memcache, then the installation is successful.

Second, in the application of PHP

1, Memcache WEB operation Process

2, know a Memcache method to use

3. What are the common methods of Memcache

Memcache:: Add -- adds a value, if it already exists, returns false

Memcache:: Addserver -- add a server address to use

Memcache:: Close -- Close a Memcache Object

Memcache:: Connect -- Create a Memcache Object

memcache_ Debug -- Control Debugging function

Memcache:: Decrement -- to one of the saved Key to subtract from the value in the

Memcache:: Delete -- Delete a Key value

Memcache:: Flush -- clear all cached data

Memcache:: Get -- get a Key value

Memcache:: Getextendedstats -- get run System statistics for all processes in the process pool

Memcache:: Getserverstatus -- get parameters for running the server

Memcache:: GetStats -- returns some running statistics for the server

Memcache:: getversion -- returns the running Memcache The version information

Memcache:: Increment -- to one of the saved Key to add the value in the

Memcache:: Pconnect -- Create a Memcache the persistent Connection object

Memcache:: Replace - R for an existing Key Overwrite Operation

Memcache:: Set -- Add a value, if it already exists, overwrite

Memcache:: Setcompressthreshold -- compress data that is larger than a certain size

Memcache:: setserverparams  -  Modify the server's parameters at run time  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.