xcache加快php

WBOY
Release: 2016-06-13 12:11:51
Original
834 people have browsed it

xcache加速php

1、安装

# tar xf xcache-3.2.0.tar.bz2

# cd xcache-3.2.0

# /usr/local/php/bin/phpize

# ./configure --enable-xcache --with-php-config=/usr/local/php/bin/php-config

# make && make install


安装结束时,会出现类似如下行:

Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20100525/


2、编辑php.ini,整合php和xcache:


首先将xcache提供的样例配置导入php.ini ,把xcache.ini的文件加在php.ini文件的最末尾;

这里需要注意的一点是vi如何在两个文件里面复制粘贴:

同时编辑两个文件,在两个文件中拷贝剪贴文本 vi file1 file2 nyy 同时打开两个文件,在文件1的光标所在处拷贝所在行 :n 切换到文件2 (n=next) p 在文件2的光标所在处粘贴所拷贝的行 :N 切换回文件1
Copy after login


Copy after login


说明:xcache.ini文件在xcache的源码目录中。


接下来编辑/opt/php/lib/php.ini,

找到extension开头的行,修改为如下行:

# vim /opt/php/lib/php.ini

extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/xcache.so

# service php-fpm restart


打开phpinfo.php检查php的运行环境:


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template