安装源码memcache-extension

[root@gaojingbo ~]# yum -y install memcached

[root@gaojingbo ~]# vim /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="200"
OPTIONS=""

[root@gaojingbo ~]# systemctl restart memcached.service 

[root@gaojingbo ~]# ps aux |grep mem

[root@gaojingbo ~]# yum -y install telnet

[root@gaojingbo ~]# yum -y install httpd php-gd gd php-mysql php-devel mariadb mairiadb-server php-cli php

[root@gaojingbo ~]# wget http://pecl.php.net/get/memcache-2.2.7.tgz


[root@gaojingbo ~]# ls
anaconda-ks.cfg  Downloads              memcache-2.2.7.tgz  Pictures  Templates
Desktop          Firefox_wallpaper.png  Music               Public    Videos
Documents        initial-setup-ks.cfg   original-ks.cfg     shell     vmware

[root@gaojingbo ~]# tar xf memcache-2.2.7.tgz  -C /usr/local/src

[root@gaojingbo ~]# cd /usr/local/src

[root@gaojingbo src]# ls
memcache-2.2.7  package.xml

[root@gaojingbo src]# cd memcache-2.2.7/

[root@gaojingbo memcache-2.2.7]# phpize 
出现错误
checking for the location of ZLIB... no
checking for the location of zlib... configure: error: memcache support requires ZLIB. Use --with-zlib-dir=<DIR> to specify prefix where ZLIB include and library are located

[root@gaojingbo memcache-2.2.7]# yum -y install zlib-devel

[root@gaojingbo memcache-2.2.7]# which php-config
/usr/bin/php-config

[root@gaojingbo memcache-2.2.7]# ./configure --prefix=/usr/local/memcached --with-php-config=/usr/bin/php-config

[root@gaojingbo memcache-2.2.7]# echo $?
0
[root@gaojingbo memcache-2.2.7]# make && make install

[root@gaojingbo memcache-2.2.7]# systemctl restart httpd

[root@gaojingbo memcache-2.2.7]# cd /var/www/html/

[root@gaojingbo html]# vim index.php
<?php
        phpinfo();
?>

[root@gaojingbo html]# systemctl restart httpd
[root@gaojingbo html]# systemctl enable httpd
[root@gaojingbo html]# vim /etc/php.ini
  添加一个extension=memcache.so

[root@gaojingbo html]# systemctl restart httpd

登陆mysql报错
[root@gaojingbo html]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
先卸载
[root@gaojingbo html]#yum remove mariadb
删除配置文件
[root@gaojingbo ~]# ls /etc/my.cnf
/etc/my.cnf
[root@gaojingbo ~]# rm -rf /etc/my.cnf
再重新安装
[root@gaojingbo ~]# yum install -y mariadb mariadb-server

[root@gaojingbo ~]# systemctl start mariadb.service 

打开浏览器


这里写图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值