---
title: "再写一个xcache的: LAMP的安装之XCache优化"
author: "philix"
date: "2011-03-14T11:55:42Z"
tags: []
categories: ["编程语言"]
slug: "xcache-lamp-xcache"
draft: false
lastmod: "2011-03-14T11:56:52Z"
id: 960963
url: "https://philix.iteye.com/blog/960963"
---

时间:2011-03-11 17:18

性能优化(根据需要，自己选择，可不做)

安装XCache

   1. sudo apt-get install php5-xcache   
   2.   
   3. root@ubuntu:/home/qii# dpkg -l | grep xcach   
   4.   
   5. ii php5-xcache 1.2.2-5 Fast, stable PHP opcode cacher   
   6. 

xcache配置文件路径是

   1. /etc/php5/conf.d/xcache.ini   
   2. 

编辑php.ini

   1. sudo gedit /etc/php5/apache2/php.ini   
   2. 

把xcache.ini的内容加入到php.ini。重启apache2

   1. sudo /etc/init.d/apache2 restart   
   2. 

检查安装是否成功

   1. root@ubuntu:/home/qii# php -v   
   2.   
   3. PHP 5.2.10-2ubuntu6 with Suhosin-Patch 0.9.7 (cli) (built: Oct 23 2009 16:30:10)   
   4.   
   5. Copyright (c) 1997-2009 The PHP Group   
   6.   
   7. Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies   
   8.   
   9. with XCache v1.2.2, Copyright (c) 2005-2007, by mOo   
  10. 

还有前面info.php页应该有XCache模块

 

 

XCache/优化

 

info页面的XCache模块

这里有点奇怪的是，如果不把xcache.ini的内容加入php.ini，apache也能载入XCache，但info.php上没XCache模块。

 

posted-by-[财路](http://www.cailu.org/)