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

这篇文章主要介绍了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

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment