How to install php memcache extension: 1. Download the memcache extension source code and decompress it; 2. Use the command to compile and install; 3. Modify php.ini and add "extension=memcache.so"; 4. Just restart php-fpm.
Recommended: "PHP Video Tutorial"
PHP 5.6.23, the most stable version currently is memcache -2.2.7.
#1. Download the extension source code and unzip it.
wget http://pecl.php.net/get/memcache-2.2.7.tgz tar zxvf memcache-2.2.7.tgz
2. Compile. Use phpize and php-config according to the actual situation.
[root@www memcache-2.2.7]# /usr/local/php/bin/phpize Configuring for: PHP Api Version: 20131106 Zend Module Api No: 20131226 Zend Extension Api No: 220131226
[root@www memcache-2.2.7]# ./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config
3. Installation. make;make install
[root@www memcache-2.2.7]# make install Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
4. Modify php.ini (add extension=memcache.so) and restart php-fpm.
# Let’s test the connectivity between php and memcache under Linux. Assume that the memcached server side is at 127.0.0.1. Generate the op_mem.php file, the code is as follows:
<?php $memcache = new Memcache; $memcache->connect('127.0.0.1',11211) or die("Could not connect Mc server"); $memcache->set('key','oldboy book'); $get= $memcache->get('key'); echo $get; ?>
Execute the file and return the corresponding value:
[root@www bbs]# /usr/local/php/bin/php op_mem.php oldboy book
For more programming-related knowledge, please visit: Programming Video Course ! !
The above is the detailed content of How to install memcache php extension?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver Mac version
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function
