Linux下php安装memcache扩展

    xiaoxiao2025-09-19  615

    安装环境:腾讯云Linux 服务器 ( CentOS )

     

    php扩展memcache的作用是为了支持memcached数据库缓存服务器,下面是安装方法。

    1、下载

    下载地址:http://pecl.php.net/package/memcache

    最新下载包:memcache-3.0.8.tgz

    文件下载成功后上传至/usr/src目录

     

    2、安装

    [root@VM_19_53_centos src]# tar -zxvf memcache-3.0.8.tgz [root@VM_19_53_centos src]# cd memcache-3.0.8 [root@VM_19_53_centos memcache-3.0.8]# /usr/local/php/bin/phpize Configuring for: PHP Api Version: 20131106 Zend Module Api No: 20131226 Zend Extension Api No: 220131226 [root@VM_19_53_centos memcache-3.0.8]# ./configure --enable-memcache --with-php-config=/usr/local/php/bin/php-config --with-zlib-dir [root@VM_19_53_centos memcache-3.0.8]# make [root@VM_19_53_centos memcache-3.0.8]# make install Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/ [root@VM_19_53_centos memcache-3.0.8]# ll /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/

    total 2420 -rwxr-xr-x 1 root root 505181 Aug 15 11:56 memcache.so -rwxr-xr-x 1 root root 1334840 Aug 14 00:41 opcache.a -rwxr-xr-x 1 root root 619139 Aug 14 00:41 opcache.so 出现memcache.so就表明安装成功了

    3、配置支持php

    [root@VM_19_53_centos memcache-3.0.8]# vim /usr/local/php/etc/php.ini 添加 extension=memcache.so :wq #保存退出

     

    4、重启服务

    [root@VM_19_53_centos memcache-3.0.8]# /etc/init.d/php-fpm restart 重启完成后,查看phpinfo可以看到memcache支持了

    转载请注明原文地址: https://ju.6miu.com/read-1302834.html
    最新回复(0)