Using the APC cache php_php Tutorial

Source: Internet
Author: User
. Overview:

Alternative PHP cache (APC) is a free, publicly available, optimized code cache for PHP. It is used to provide free, open and robust architecture to cache and optimize PHP's intermediate code.

Note:

1. Under Windows, APC needs to have a temporary path, and the Web server has writable permissions. It checks the TMP, TEMP, and userprofile environment variables sequentially, and if they are not set, the Windows directory is used at the end.

2. APC does not support distribution.

II. Installation:

Download the pecl DLL package from pecl4win.net.php and put it in the Php5/ext directory. In fact, the php5.2.5 corresponding PECL package already contains this file.

III. Configuration

Open php.ini, add code:

Extension=php_apc.dll

[APC]

apc.enabled = 1

Apc.shm_segments = 1

Apc.shm_size = 64

Apc.max_file_size = 10M

Apc.stat=1

Iv. Script test:

To restart the Web server, test:

1). Set the entries to be cached.

store.php

$bar = ' Bar ';

Apc_store (' foo ', $bar);

?>

2). Gets the cached entry.

fetch.php

Var_dump (Apc_fetch (' foo '));

?>

Run store.php, then run fetch.php to see the effect.

http://www.bkjia.com/PHPjc/478711.html www.bkjia.com true http://www.bkjia.com/PHPjc/478711.html techarticle . Overview: Alternative PHP cache (APC) is a free, publicly available, optimized code cache for PHP. It is used to provide free, open and robust architecture to cache and optimize PHP's intermediate code. ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.