Quantcast
Channel: 看得透又看得远者prevail. ppt.cc/flUmLx ppt.cc/fqtgqx ppt.cc/fZsXUx ppt.cc/fhWnZx ppt.cc/fnrkVx ppt.cc/f2CBVx
Viewing all articles
Browse latest Browse all 20535

使用Redis来加速WordPress

$
0
0
1、编辑PHP配置文件:
vi /usr/local/php/etc/php.ini
寻找disable_functions字符串,将后面的scandir删除
2、重启PHP生效
/etc/init.d/php-fpm restart

3、前端缓存的 PHP 脚本

1.在 WordPress的根目录创建新文件 index-with-redis.php,下载地址
2.修改文件中的变量进行自定义
3.如果使用Apache,需在 .htaccess 中将所有出现 index.php 的地方改为 index-with-redis.php ;如果使用的是 Nginx,则将WordPress中的index.php重命名,并将index-with-redis.php 重命名为index.php。需要注意的是在每次升级后需要重新进行上述操作。
同时,需要在 Nginx 配置文件中单独对 /wp-admin/ 指定一下 index.php 文件. 类似如下:
location /wp-admin {
index index
.php;
}
参考文献:
  1. http://dbanotes.net/sitelog/movable-type-2-wordpress.html
  2. How to load WordPress in a few milliseconds using Redis
  3. Redis几个认识误区

Viewing all articles
Browse latest Browse all 20535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>