jasonstar 发表于 2017-2-12 12:29:46

只安装php-memcached客户端

军哥我只想安装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 ../
}

licess 发表于 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
页: [1]
查看完整版本: 只安装php-memcached客户端