VPS侦探论坛

 找回密码
 注册
查看: 3296|回复: 1

只安装php-memcached客户端

[复制链接]
发表于 2017-2-12 12:29:46 | 显示全部楼层 |阅读模式

军哥我只想安装php的memcached扩展,不需要服务端!是不是memcached.sh 脚本 留这一段就行了  然后运行就可以了?

Install_PHPMemcached()
{
    echo "Install memcached php extension..."
    cd ${cur_dir}/src
    Get_Dist_Name
    if [ "$PM" = "yum" ]; then
        yum install cyrus-sasl-devel -y
        Get_Dist_Version
        if echo "${CentOS_Version}" | grep -Eqi '^5.'; then
            yum install gcc44 gcc44-c++ libstdc++44-devel -y
            export CC="gcc44"
            export CXX="g++44"
        fi
    elif [ "$PM" = "apt" ]; then
        apt-get install libsasl2-2 sasl2-bin libsasl2-2 libsasl2-dev libsasl2-modules -y
    fi
    Download_Files ${Download_Mirror}/web/libmemcached/${Libmemcached_Ver}.tar.gz
    Tar_Cd ${Libmemcached_Ver}.tar.gz ${Libmemcached_Ver}
    ./configure --prefix=/usr/local/libmemcached --with-memcached
    make && make install
    cd ../

    if echo "${Cur_PHP_Version}" | grep -Eqi '^7.';then
        cd ${cur_dir}/src
        rm -rf php-memcached
        git clone -b php7 https://github.com/php-memcached-dev/php-memcached.git
        cd php-memcached
    else
        Download_Files ${Download_Mirror}/web/php-memcached/${PHPMemcached_Ver}.tgz ${PHPMemcached_Ver}.tgz
        Tar_Cd ${PHPMemcached_Ver}.tgz ${PHPMemcached_Ver}
    fi
    /usr/local/php/bin/phpize
    ./configure --with-php-config=/usr/local/php/bin/php-config --enable-memcached --with-libmemcached-dir=/usr/local/libmemcached
    make && make install
    cd ../
}
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-2-12 19:15:00 | 显示全部楼层


Install_Memcached() 里 echo "Install memcached..." 到 StartUp memcached 删掉

    echo "Starting Memcached..."
    /etc/init.d/memcached start
删掉

if [ -s "${zend_ext}" ] && [ -s /usr/local/memcached/bin/memcached ]; then 替换为 if [ -s "${zend_ext}" ]; then
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-17 03:29 , Processed in 0.025821 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表