Home php教程 php手册 php配置memcache缓存方法

php配置memcache缓存方法

May 25, 2016 pm 04:39 PM
memcache cache php cache

1、下载memcache  放到自己的盘符下面  例如:d:memcached

2、开始->cmd->输入命令d:memcachedmemcached.exe -d install  安装

3、安装完成后输入d:memcachedmemcached.exe -d start 

4、下载php_memcache.dll,注意自己的php版本的文件 放到你的php下的ext/下面

5、在php.ini 加入一行 extension=php_memcache.dll

6、重启apache 查看你的phpinfo里面是否有memcache,如果有就说明成功安装

7、测试代码,代码如下:

<?php 
	$mem = new Memcache; 
	$mem->connect("127.0.0.1",11211); 
	$mem->set(&#39;key&#39;,&#39;test memcache successfull&#39;,0,100); 
	$val=$mem->get(&#39;key&#39;);//开源代码phprm.com 
	echo $val; 
	 
Copy after login

如果输出了“test memcache successfull”说明安装成功了.

教程地址:

欢迎转载!但请带上文章地址^^

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to use PHP development cache to optimize image loading speed How to use PHP development cache to optimize image loading speed Nov 08, 2023 pm 05:58 PM

How to use PHP to develop cache and optimize image loading speed. With the rapid development of the Internet, web page loading speed has become one of the important factors in user experience. Image loading speed is one of the important factors affecting web page loading speed. In order to speed up the loading of images, we can use PHP development cache to optimize the image loading speed. This article will introduce how to use PHP to develop cache to optimize image loading speed, and provide specific code examples. 1. Principle of cache Cache is a technology for storing data by temporarily storing data in high-speed memory.

Output caching in PHP Output caching in PHP May 23, 2023 pm 08:10 PM

Output caching in the PHP language is one of the commonly used performance optimization methods, which can greatly improve the performance of web applications. This article will introduce output caching in PHP and how to use it to optimize the performance of web applications. 1. What is output caching? In web applications, when we use PHP to output a piece of HTML code, PHP will output this code to the client line by line. Each line output will be immediately sent to the client. This method will cause a large number of network I/O operations, and network I/O is a bottleneck for web application performance.

How to improve website access speed through PHP cache development How to improve website access speed through PHP cache development Nov 07, 2023 pm 05:03 PM

With the development of the Internet, website access speed has become one of the important factors for users to choose a website. For large websites with huge traffic, each page request may take a lot of time and resources. In order to solve this problem, we can greatly improve the access speed of the website by using caching technology. This article will introduce how to improve the access speed of the website through PHP cache development, including specific code examples. 1. Caching Concept and Principle Caching is a method of temporarily storing frequently used data in high-speed memory so that it can be retrieved faster.

Research on the consistency and reliability of PHP data cache Research on the consistency and reliability of PHP data cache Aug 10, 2023 pm 06:10 PM

Research on the consistency and reliability of PHP data caching Introduction: In web development, data caching is one of the important means to improve application performance. As a commonly used server-side scripting language, PHP also provides a variety of data caching solutions. However, when using these caching solutions, we need to consider cache consistency and reliability issues. This article will explore the consistency and reliability of PHP data caching and provide corresponding code examples. 1. The issue of cache consistency When using data caching, the most important issue is how to ensure caching

Understanding PHP caching mechanisms: exploring different implementations Understanding PHP caching mechanisms: exploring different implementations Jan 23, 2024 am 09:53 AM

Explore the PHP caching mechanism: Understand different implementation methods and require specific code examples. The caching mechanism is a very important part of web development and can greatly improve the performance and response speed of the website. As a popular server-side language, PHP also provides a variety of caching mechanisms to optimize performance. This article will explore PHP's caching mechanism, introduce different implementation methods, and provide specific code examples. File Cache File cache is one of the simplest and most common PHP caching methods. Its principle is very simple

How to implement efficient data caching in PHP projects? How to implement efficient data caching in PHP projects? Aug 10, 2023 pm 03:05 PM

How to implement efficient data caching in PHP projects? Introduction: In developing PHP projects, data caching is a very important technology that can significantly improve the performance and response speed of the application. This article will introduce how to implement efficient data caching in PHP projects, including selecting appropriate caching technology, life cycle management of cached data, and usage examples. 1. Choose the appropriate caching technology. File caching: Use the file system to store cached data. The cached data can be saved on the disk. It is durable and suitable for processing large amounts of data, but reading

How to optimize page caching effect through php function? How to optimize page caching effect through php function? Oct 05, 2023 am 11:17 AM

How to optimize page caching effect through PHP function? Overview: In website development, optimizing page caching is one of the important links in improving user experience and website performance. By properly setting the page cache, you can reduce the load on the server, speed up page loading, and improve user access experience. And PHP function is one of the tools we can use. This article will introduce some basic PHP functions and how to use them to optimize page caching. 1. Understand the PHP function: ob_start() function:

PHP Fast Cache Introduction and Usage Guide PHP Fast Cache Introduction and Usage Guide Jul 07, 2023 am 11:23 AM

Overview of PHP Fast Cache Introduction and Usage Guide: In today's Internet application development, performance has always been the focus of developers. In high-concurrency scenarios, special attention needs to be paid to data reading and loading efficiency. As a scripting language, PHP has relatively low operating efficiency, so caching plays an extremely important role. This article will introduce the concept of PHP fast caching and how to use caching to improve application performance. What is cache? Cache is a means of saving data by saving some data obtained through calculation or IO operations in order to

See all articles