php 开启memcache,[wdcp]php73版本开启memcache缓存(开启PHP扩展)

wdcp 更新到 v3.3.7,突然感觉系统跑的不是很快,之前一直没有开启缓存的功能,是觉得这么点压力,php还不是问题,但最近的确很慢。为此还是开下memcache做页面缓存吧。

1.环境信息system = centos 7.2

php = 7.3

wdcp = v3.3.7

2.安装MemCached

首先看下面板后台,系统设置->MemCached有没有开启,这里我因为之前已经安装过了,这篇文章不介绍如何安装。

3.安装php扩展

进入php目录,下载memcache,并且解压cd /www/wdlinux/phps/73

wget https://pecl.php.net/get/memcache-4.0.5.2.tgz

tar -zxvf memcache-4.0.5.2.tgz

cd memcache-4.0.5.2

执行phpize,生成configure[root]#./../bin/phpize

Configuring for:

PHP Api Version: 20180731

Zend Module Api No: 20180731

Zend Extension Api No: 320180731

预配置[root]# ./configure --with-php-config=/www/wdlinux/phps/73/bin/php-config

checking for grep that handles long lines and -e... /usr/bin/grep

checking for egrep... /usr/bin/grep -E

checking for a sed that does not truncate output... /usr/bin/sed

.................

creating libtool

appending configuration tag "CXX" to libtool

configure: creating ./config.status

config.status: creating config.h

编译并安装[root]# make && make install

/bin/sh /www/wdlinux/phps/73/memcache-4.0.5.2/libtool --mode=compile cc -I/www/wdlinux/phps/73/include/php -I. -I/www/wdlinux/phps/73/memcache-4.0.5.2 -DPHP_ATOM_INC -I/www/wdlinux/phps/73/memcache-4.0.5.2/include -I/www/wdlinux/phps/73/memcache-4.0.5.2/main -I/www/wdlinux/phps/73/memcache-4.0.5.2 -I/www/wdlinux/phps/73/include/php -I/www/wdlinux/phps/73/include/php/main -I/www/wdlinux/phps/73/include/php/TSRM -I/www/wdlinux/phps/73/include/php/Zend -I/www/wdlinux

..................

Libraries have been installed in:

/www/wdlinux/phps/73/memcache-4.0.5.2/modules

If you ever happen to want to link against installed libraries

in a given directory, LIBDIR, you must either use libtool, and

specify the full pathname of the library, or use the `-LLIBDIR'

flag during linking and do at least one of the following:

- add LIBDIR to the `LD_LIBRARY_PATH' environment variable

during execution

- add LIBDIR to the `LD_RUN_PATH' environment variable

during linking

- use the `-Wl,--rpath -Wl,LIBDIR' linker flag

- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for

more information, such as the ld(1) and ld.so(8) manual pages.

----------------------------------------------------------------------

Build complete.

Don't forget to run 'make test'.

Installing shared extensions: /www/wdlinux/phps/73/lib/php/extensions/no-debug-non-zts-20180731/

最后会有个提示Installing shared extensions:这个后面的路径要记录下来。[root]# vim /www/wdlinux/phps/73/etc/php.ini

在最后增加[Memcached]

extension_dir = "/www/wdlinux/phps/73/lib/php/extensions/no-debug-non-zts-20180731/"

extension=memcache.so

在wdcp面板重启对应版本的php网站管理->PHP版本管理

然后在ssh中输入:[root]# cd /www/wdlinux/phps/73/bin/

[root]# ./php -m | grep memcache

memcache

看到输出memcache就证明成功了。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值