Home Backend Development PHP Tutorial Install memcache and memcached_PHP tutorial

Install memcache and memcached_PHP tutorial

Jul 20, 2016 am 11:09 AM
memcache memcached name and Install yes of Simple system cache project

Simply put

Memcache is the name of the general cache system project, which is easily confused with memcache in the PHP tutorial.

We often mention that memcache is actually memcache in php, which is the memcached extension support of php.

We often mention that memcached is the main program file of the server and the installation program of the server.

In order to make your program fly, you must install the memcached server program and the memcached extension of php, so if you want to use memcache to cache the system, we need to install both memcache and memcached.

Install memcache

# cd /usr/local/src
# wget http://pecl.php.net/get/memcache-2.2.5.tgz
# gzip -d memcache-2.2.5.tgz
# tar xvf memcache-2.2.5.tar
# cd memcache-2.2.5

The following sentences refer to the directory where php is located as / usr/local/php as an example. If your php has changed, please replace the part of /usr/local/php in the sentences

# /usr/local/php/bin/phpize
# ./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir
# make && make install

will memcache added php extension

# vi /etc/php.ini (/etc/php.ini address is the location of my php.ini. If you don’t know where your php.ini is, you can use # find / -name php.ini to search, or pass a probe phpinfo to find the location of php.ini in the configuration file (php.ini) path).

Add

to the end and press on the keyboard i Start editing

ctrl+f to scroll to the bottom and add

extension_dir = "/usr/local/php/lib/php/extensions/no-debug before [zend] -non-zts-20060613/"
extension=memcache.so

Press the esc key and enter

: wq

Save and exit

Restart your web server, such as apache

/etc/init.d/httpd restart

Next, refresh the php probe to see if this is available. If so, install it.

memcache
version 2.2.5memcache
version 2.2.5

Install memcached below

To install memcached, you first need to install libevent

If it is centos, you can install it with yum

# yum install libevent-devel

If the system does not support yum, you can install libevent like this

# cd / usr/local/src
# wget http://www.monkey.org/~provos/libevent-1.4.12-stable.tar.gz
# tar vxf libevent-1.4.12-stable.tar. gz
# cd libevent-1.4.12
# ./configure --prefix=/usr/local/libevent
# make && make install

Continue to install memcached

# cd /usr/local/src
# wget http://cloud.github.com/downloads/saberma/saberma.github.com/memcached-1.4.4.tar.gz
# tar vxf memcached -1.4.4.tar.gz
# cd memcached-1.4.4
# ./configure --prefix=/usr/local/memcached
# make && make install

Installation After completion, start memcached and allocate 32m of memory (32 is the number of used memory, which can be modified according to your own situation)

/usr/local/memcached/bin/memcached -d -m 32 -l 127.0.0.1 -p 11211 -u root

Add memcached to startup items

# vi /etc/rc.d/rc.local

Press i on the keyboard to start editing

Add

/usr/local/memcached/bin/memcached -d -m 32 -l 127.0.0.1 -p 11211 -u root at the end

Press the esc key and enter

:wq

Save and exit

If necessary, you can reboot, but it should have taken effect without reboot~

Acceleration effect test

Use Do a test with discuz x1 without any load. When it is not enabled,

gmt+8, 2010-9-12 09:08, processed in 0.038893 second(s), 2 queries.

Cache The effect after enabling it, but the overall feeling is that the effect in the vps tutorial is not as obvious as the effect of adding eaccelerato cache

gmt+8, 2010-9-12 09:08, processed in 0.008383 second(s), 2 queries, memcache on.

Complete

and install memcached below

To install memcached, you first need to install libevent

If it is centos, you can install it with yum

# yum install libevent-devel

If the system does not support yum, you can install libevent like this

# cd /usr/local/src
# wget http://www.monkey. org/~provos/libevent-1.4.12-stable.tar.gz
# tar vxf libevent-1.4.12-stable.tar.gz
# cd libevent-1.4.12
# ./configure --prefix=/usr/local/libevent
# make && make install

Continue to install memcached

# cd /usr/local/src
# wget http://cloud.github.com/downloads/saberma/saberma.github.com/memcached-1.4.4.tar.gz
# tar vxf memcached-1.4.4.tar.gz
# cd memcached-1.4.4
# ./configure --prefix=/usr/local/memcached
# make && make install

After installation, start memcached and allocate 32m of memory (32 is the number of used memory, which can be modified according to your own situation)

/usr/local/memcached/bin/memcached -d -m 32 -l 127.0.0.1 - p 11211 -u root

Add memcached to the startup items

# vi /etc/rc.d/rc.local

Press i on the keyboard to start editing

Add

/usr/local/memcached/bin/memcached -d -m 32 -l 127.0.0.1 -p 11211 -u root at the end

Press the esc key and enter

: wq

Save and exit

If necessary, you can reboot, but it should have taken effect without rebooting~

Acceleration effect test

Use discuz x1 with no load to do a test, when it is not enabled

gmt+8, 2010-9-12 09:08, processed in 0.038893 second(s), 2 queries.

The effect after caching is enabled, but the overall effect on vps is not as obvious as the effect of using eaccelerato cache

gmt+8, 2010-9-12 09:08, processed in 0.008383 second(s), 2 queries , memcache on.

Completed


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/444801.htmlTechArticleSimply put, memcache is the name of the general cache system project, which is easily confused with memcache in the PHP tutorial. We often mention that memcache is actually memcache in php, that is, php's memcached extension support. ...
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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

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)

CUDA's universal matrix multiplication: from entry to proficiency! CUDA's universal matrix multiplication: from entry to proficiency! Mar 25, 2024 pm 12:30 PM

General Matrix Multiplication (GEMM) is a vital part of many applications and algorithms, and is also one of the important indicators for evaluating computer hardware performance. In-depth research and optimization of the implementation of GEMM can help us better understand high-performance computing and the relationship between software and hardware systems. In computer science, effective optimization of GEMM can increase computing speed and save resources, which is crucial to improving the overall performance of a computer system. An in-depth understanding of the working principle and optimization method of GEMM will help us better utilize the potential of modern computing hardware and provide more efficient solutions for various complex computing tasks. By optimizing the performance of GEMM

Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time Huawei's Qiankun ADS3.0 intelligent driving system will be launched in August and will be launched on Xiangjie S9 for the first time Jul 30, 2024 pm 02:17 PM

On July 29, at the roll-off ceremony of AITO Wenjie's 400,000th new car, Yu Chengdong, Huawei's Managing Director, Chairman of Terminal BG, and Chairman of Smart Car Solutions BU, attended and delivered a speech and announced that Wenjie series models will be launched this year In August, Huawei Qiankun ADS 3.0 version was launched, and it is planned to successively push upgrades from August to September. The Xiangjie S9, which will be released on August 6, will debut Huawei’s ADS3.0 intelligent driving system. With the assistance of lidar, Huawei Qiankun ADS3.0 version will greatly improve its intelligent driving capabilities, have end-to-end integrated capabilities, and adopt a new end-to-end architecture of GOD (general obstacle identification)/PDP (predictive decision-making and control) , providing the NCA function of smart driving from parking space to parking space, and upgrading CAS3.0

Can AI conquer Fermat's last theorem? Mathematician gave up 5 years of his career to turn 100 pages of proof into code Can AI conquer Fermat's last theorem? Mathematician gave up 5 years of his career to turn 100 pages of proof into code Apr 09, 2024 pm 03:20 PM

Fermat's last theorem, about to be conquered by AI? And the most meaningful part of the whole thing is that Fermat’s Last Theorem, which AI is about to solve, is precisely to prove that AI is useless. Once upon a time, mathematics belonged to the realm of pure human intelligence; now, this territory is being deciphered and trampled by advanced algorithms. Image Fermat's Last Theorem is a "notorious" puzzle that has puzzled mathematicians for centuries. It was proven in 1993, and now mathematicians have a big plan: to recreate the proof using computers. They hope that any logical errors in this version of the proof can be checked by a computer. Project address: https://github.com/riccardobrasca/flt

How to install Android apps on Linux? How to install Android apps on Linux? Mar 19, 2024 am 11:15 AM

Installing Android applications on Linux has always been a concern for many users. Especially for Linux users who like to use Android applications, it is very important to master how to install Android applications on Linux systems. Although running Android applications directly on Linux is not as simple as on the Android platform, by using emulators or third-party tools, we can still happily enjoy Android applications on Linux. The following will introduce how to install Android applications on Linux systems.

Always new! Huawei Mate60 series upgrades to HarmonyOS 4.2: AI cloud enhancement, Xiaoyi Dialect is so easy to use Always new! Huawei Mate60 series upgrades to HarmonyOS 4.2: AI cloud enhancement, Xiaoyi Dialect is so easy to use Jun 02, 2024 pm 02:58 PM

On April 11, Huawei officially announced the HarmonyOS 4.2 100-machine upgrade plan for the first time. This time, more than 180 devices will participate in the upgrade, covering mobile phones, tablets, watches, headphones, smart screens and other devices. In the past month, with the steady progress of the HarmonyOS4.2 100-machine upgrade plan, many popular models including Huawei Pocket2, Huawei MateX5 series, nova12 series, Huawei Pura series, etc. have also started to upgrade and adapt, which means that there will be More Huawei model users can enjoy the common and often new experience brought by HarmonyOS. Judging from user feedback, the experience of Huawei Mate60 series models has improved in all aspects after upgrading HarmonyOS4.2. Especially Huawei M

How to install Podman on Ubuntu 24.04 How to install Podman on Ubuntu 24.04 Mar 22, 2024 am 11:26 AM

If you have used Docker, you must understand daemons, containers, and their functions. A daemon is a service that runs in the background when a container is already in use in any system. Podman is a free management tool for managing and creating containers without relying on any daemon such as Docker. Therefore, it has advantages in managing containers without the need for long-term backend services. Additionally, Podman does not require root-level permissions to be used. This guide discusses in detail how to install Podman on Ubuntu24. To update the system, we first need to update the system and open the Terminal shell of Ubuntu24. During both installation and upgrade processes, we need to use the command line. a simple

How to Install and Run the Ubuntu Notes App on Ubuntu 24.04 How to Install and Run the Ubuntu Notes App on Ubuntu 24.04 Mar 22, 2024 pm 04:40 PM

While studying in high school, some students take very clear and accurate notes, taking more notes than others in the same class. For some, note-taking is a hobby, while for others, it is a necessity when they easily forget small information about anything important. Microsoft's NTFS application is particularly useful for students who wish to save important notes beyond regular lectures. In this article, we will describe the installation of Ubuntu applications on Ubuntu24. Updating the Ubuntu System Before installing the Ubuntu installer, on Ubuntu24 we need to ensure that the newly configured system has been updated. We can use the most famous "a" in Ubuntu system

Detailed steps to install Go language on Win7 computer Detailed steps to install Go language on Win7 computer Mar 27, 2024 pm 02:00 PM

Detailed steps to install Go language on Win7 computer Go (also known as Golang) is an open source programming language developed by Google. It is simple, efficient and has excellent concurrency performance. It is suitable for the development of cloud services, network applications and back-end systems. . Installing the Go language on a Win7 computer allows you to quickly get started with the language and start writing Go programs. The following will introduce in detail the steps to install the Go language on a Win7 computer, and attach specific code examples. Step 1: Download the Go language installation package and visit the Go official website

See all articles