Home > php教程 > php手册 > Linux下PHP加速器APC的安装与配置笔记

Linux下PHP加速器APC的安装与配置笔记

WBOY
Release: 2016-06-06 20:18:33
Original
1090 people have browsed it

这篇文章主要介绍了Linux下PHP加速器APC的安装与配置笔记,本文同时给出了Windows下安装apc的方法,需要的朋友可以参考下

当前我用的是APC-3.1.9 stable ,可以自己到 下载最新版。

1、安装

复制代码 代码如下:


wget
tar xzvf APC-3.1.9.tgz
cd APC-3.1.9
/usr/local/php/bin/phpize
./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/local/php/bin/php-config --prefix=/usr/local/apc
make && make install

注:安装编译后检查相应目录:

复制代码 代码如下:


ll /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
-rwxr-xr-x 1 root root 659164 Apr 8 18:30 apc.so

安装成功!

2、配置/usr/local/php/etc/php.ini

复制代码 代码如下:


vi /usr/local/php/etc/php.ini

shift+g到最末行,,末尾加入

复制代码 代码如下:


[apc]
extension="/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/apc.so"
apc.enabled = 1
apc.cache_by_default = on
apc.shm_segments = 1
apc.shm_size = 64
apc.ttl = 7200
apc.user_ttl = 7200
apc.num_files_hint = 0
apc.write_lock = On

然后把APC目录下的apc.php复制到可以访问的目录

复制代码 代码如下:


cp /root/APC-3.1.9/apc.php /home/wwwroot/

3、重启 LNMPA

复制代码 代码如下:


/root/lnmpa restart

4、附:Windows下安装apc方法

下载地址:

复制代码 代码如下:


extension = php_apc.dll

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template