[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
打开浏览器
安装源码memcache-extension
最新推荐文章于 2024-03-06 11:31:44 发布