PHPOPCode cache APC details

Source: Internet
Author: User
Tags apc apc configuration
Compared with other compiled languages, the performance of PHP is not outstanding, but the performance improvement is obvious after the OPCode cache is used. common examples include Eaccelerator, XCache, and APC. this document mainly introduces the use of APC. APC introduction

The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code.

APC official website: http://www.php.net/manual/en/book.apc.php

Windows under the latest version of: http://downloads.php.net/pierre/

Download link: The http://downloads.php.net/pierre/php_apc-3.1.4-5.3-VC6-x86.zip uses the corresponding DLL based on your PHP build

APC configuration

APC configuration mainly describes the configuration in Windows. There are many articles on configuration in linux.

1. download php_apc.dll to the PHP ext directory.

2. modify php. ini to add extension = php_apc.dll

Add configuration items at the end of php. ini

; APC Setting
[APC]
; An error will be reported when stat is enabled.
; Apc. stat = 0
Apc. enabled = "1 ″
Apc. shm_segments = "1 ″
The problem here is that the default memory configuration for Windows 7 is changed. do you know if you have any problems?
; Apc. shm_size = "128 ″
; Apc. ttl = 7200
; Apc. user_ttl = 7200
; Corrected metric data
Apc. ttl = "300 ″
Apc. user_ttl = "300 ″
Apc. num_files_hint = "1024 ″
Apc. mmap_file_mask = "E:/Wamp/tmp/apc. XXXXXX"
Apc. enable_cli = "1 ″

3. restart the apache server and check whether the apc configuration item exists in phpinfo. If yes, the configuration is successful.

APC control panel, control files from APC-3.1.4.tgz

Before cache is used

After cache is used

FAQs:

1. what is the Cache clearing problem for OPCode under fcgi?

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.