How to install memcache extension in php

王林
Release: 2023-03-04 21:04:02
Original
2577 people have browsed it

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
Copy after login

3. Recompile

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

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

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

(Learning video recommendation: php video tutorial)

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

extension=/usr/local/opt/php55-memcache/memcache.so
Copy after login

6. Restart php-fpm

pkill php/usr/local/sbin/php-fpm &
Copy after login

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!

Related labels:
php
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!