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.
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:
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!