Directadmin安装XCache

  1. mkdir -p /usr/local/src/xcache
  2. cd /usr/local/src/xcache
  3. wget http://xcache.lighttpd.net/pub/Releases/2.0.0/xcache-2.0.0.tar.gz
  4. tar zxf xcache-2.0.0.tar.gz 
  5. cd xcache-2.0.0
  6. ./configure --enable-xcache
  7. make && make install
  8.  
  9. /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
  10.  
  11. vim /usr/local/etc/php5/cgi/php.ini
  12.  
  13. ########################################################################
  14. [xcache-common]
  15. ;; install as zend extension (recommended), normally "$extension_dir/xcache.so"
  16. zend_extension = /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so
  17. ; zend_extension_ts = /usr/local/lib/php/extensions/non-debug-zts-xxx/xcache.so
  18. ;; For windows users, replace xcache.so with php_xcache.dll
  19. zend_extension_ts = c:/php/extensions/php_xcache.dll
  20. ;; or install as extension, make sure your extension_dir setting is correct
  21. ; extension = xcache.so
  22. ;; or win32:
  23. ; extension = php_xcache.dll
  24.  
  25. [xcache.admin]
  26. xcache.admin.enable_auth = On
  27. xcache.admin.user = "mOo"
  28. ; xcache.admin.pass = md5($your_password)
  29. xcache.admin.pass = ""
  30.  
  31. [xcache]
  32. ; ini only settings, all the values here is default unless explained
  33.  
  34. ; select low level shm/allocator scheme implemenation
  35. xcache.shm_scheme =        "mmap"
  36. ; to disable: xcache.size=0
  37. ; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows
  38. xcache.size  =               60M
  39. ; set to cpu count (cat /proc/cpuinfo |grep -c processor)
  40. xcache.count =                 1
  41. ; just a hash hints, you can always store count(items) > slots
  42. xcache.slots =                8K
  43. ; ttl of the cache item, 0=forever
  44. xcache.ttl   =                 0
  45. ; interval of gc scanning expired items, 0=no scan, other values is in seconds
  46. xcache.gc_interval =           0
  47.  
  48. ; same as aboves but for variable cache
  49. xcache.var_size  =            4M
  50. xcache.var_count =             1
  51. xcache.var_slots =            8K
  52. ; default ttl
  53. xcache.var_ttl   =             0
  54. xcache.var_maxttl   =          0
  55. xcache.var_gc_interval =     300
  56.  
  57. ; N/A for /dev/zero
  58. xcache.readonly_protection = Off
  59. ; for *nix, xcache.mmap_path is a file path, not directory.
  60. ; Use something like "/tmp/xcache" if you want to turn on ReadonlyProtection
  61. ; 2 group of php won't share the same /tmp/xcache
  62. ; for win32, xcache.mmap_path=anonymous map name, not file path
  63. xcache.mmap_path =    "/dev/zero"
  64.  
  65.  
  66. ; leave it blank(disabled) or "/tmp/phpcore/"
  67. ; make sure it's writable by php (open_basedir is not checked)
  68. xcache.coredump_directory =   ""
  69.  
  70. ; per request settings
  71. xcache.cacher =               On
  72. xcache.stat   =               On
  73. xcache.optimizer =           Off
  74.  
  75. xcache.test =                Off
  76. xcache.experimental =        Off
  77.  
  78. [xcache.coverager]
  79. ; per request settings
  80. ; enable coverage data collecting for xcache.coveragedump_directory and xcache_coverager_start/stop/get/clean() functions (will hurt
  81.  executing performance)
  82. xcache.coverager =          Off
  83.  
  84. ; ini only settings
  85. ; make sure it's readable (open_basedir is checked) by coverage viewer script
  86. ; requires xcache.coverager=On
  87. xcache.coveragedump_directory = ""
  88.  
  89. ########################################################################
  90.  
  91. 如果php -v提示找不到xcache.so 要进php.ini改成正确的xcache.so的路径
  92. [root@baiqiuyi ~]# php -v
  93. Failed loading /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so: /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so: cannot open shared object file: No such file or directory
  94. PHP 5.2.17 (cli) (built: Jun 28 2012 00:15:29) 
  95. Copyright (c) 1997-2010 The PHP Group
  96. Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
  97.     with the ionCube PHP Loader v4.0.10, Copyright (c) 2002-2011, by ionCube Ltd., and
  98.     with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
  99.  
  100. [root@baiqiuyi ~]# php -v
  101. PHP 5.2.17 (cli) (built: Jun 28 2012 00:15:29) 
  102. Copyright (c) 1997-2010 The PHP Group
  103. Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
  104.     with XCache v2.0.0, Copyright (c) 2005-2012, by mOo
  105.     with the ionCube PHP Loader v4.0.10, Copyright (c) 2002-2011, by ionCube Ltd., and
  106.     with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
1 1