Home >Backend Development >PHP Problem >How to install memcache extension in php

How to install memcache extension in php

王林
王林Original
2020-08-20 14:35:372624browse

How to install the memcache extension in php: 1. Download the extension compressed package; 2. Unzip the compressed package; 3. Recompile; 4. Copy the memcache.so file to the corresponding directory; 5. In the configuration file Add extensions; 6. Restart php-fpm.

How to install memcache extension in php

Installation method:

(Recommended tutorial: php graphic tutorial)

1. Download the extension source code

Download the memcache version that suits you. This time, choose version 3.0.8

2. Unzip the download package

tar -zxvf memcached-3.0.8.tgzcd memcached-3.0.8

3. Recompile

phpize && ./configure --enable-memcache --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11 && make

4. Copy the memcache.so file to the corresponding directory:

cd modules/cp memcache.so /usr/local/opt/php55-memcache/

(Learning video recommendation: php video tutorial)

5. In php.ini Add configuration to the file:

extension=/usr/local/opt/php55-memcache/memcache.so

6. Restart php-fpm

pkill php/usr/local/sbin/php-fpm &

7. If you see the following configuration in phpinfo(), it is successful:

How to install memcache extension in php

The above is the detailed content of How to install memcache extension in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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