Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Source code era PHP practical information sharing | Linux system installation memcached, rookie counterattack essential tutorial!

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Linux system installs memcached

1. First, install the libeventlibrary.

Yum install libevent libevent-devel

two。 Source code installation memcached

Wget online download tool

Yum install-y wget# download source code online

Wget http://memcached.org/files/memcached-1.5.16.tar.gz

Tar xf memcached-1.5.16.tar.gz

Cd memcached-1.5.16, # configuration

. / configure-- prefix=/usr/local/lamp/memcached

Make

Make install

Run memcached

/ usr/local/lamp/memcached/bin/memcached-d-m 64m-u root-p 11211-c 256

4. Check to see if memcached is running

Ps aux | grep memcached

Use PHP code to manipulate memcached download and install libmemcached

Cd / root/software

Wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz

Tar xf libmemcached-1.0.18.tar.gz

Cd libmemcached-1.0.18

. / configure-prefix=/usr/local/libmemcached-with-memcached

Make

Make install

two。 Install the memcached extension

Cd / root/software

Wget https://pecl.php.net/get/memcached-3.1.3.tgz

Tar xf memcached-3.1.3.tgz

Cd memcached-3.1.3

/ usr/local/lamp/php/bin/phpize

. / configure-- with-php-config=/usr/local/lamp/php/bin/php-config\

-with-libmemcached-dir=/usr/local/libmemcached-disable-memcached-sasl

Make

Make install

3. Modify php.ini to add memcached extension

Echo "extension=memcached.so" > > / usr/local/lamp/php/lib/php.ini

4. Restart the apache server

Service httpd restart

5. Write PHP code to manipulate memcached

Check the php manual: https://www.php.net/manual/zh/book.memcached.php

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report