Home > Backend Development > PHP Tutorial > php-memcached extension installation

php-memcached extension installation

不言
Release: 2023-03-24 20:58:02
Original
3687 people have browsed it

The content of this article is about php-memcached extension installation, which has certain reference value. Now I share it with everyone. Friends in need can refer to it

[libmemcached installation 】

# wget https://launchpadlibrarian.net/165454254/libmemcached-1.0.18.tar.gz
# tar -zxvf libmemcached-1.0.18.tar.gz
# cd libmemcached-1.0.18
# ./configure --prefix=/usr/local/libmemcached --with-memcached
# make && make install
Copy after login

php-memcachedINSTALL】

# wget https://pecl.php.net/get/memcached-3.0.4.tgz
# mv memcached-3.0.4.tgz php-memcached-3.0.4.tgz
# tar -zxvf php-memcached-3.0.4.tgz
# mv memcached-3.0.4 php-memcached-3.0.4
# cd php-memcached-3.0.4
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached/ --disable-memcached-sasl
# make && make install

修改php.ini文件

添加一行:
[memcached]
extension = memcached.so
重启php-fpm:kill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`
Copy after login

php test

$m = new Memcached();
$m->addServer('127.0.0.1','11211');
print_r($m->getStats());
Copy after login

Related recommendations:

php-redis extension installation (phpredis)


The above is the detailed content of php-memcached extension installation. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template