In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what does apc refer to in php". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is apc in php".
In php, the full name of apc is "Alternative PHP Cache", which means "optional PHP cache" in Chinese. It is an open source cache tool that is effective for PHP and can be used to cache and optimize PHP code on Web servers to improve server performance.
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
Introduction to Alternative PHP Cache (APC)
The full name of Alternative PHP Cache (APC) in Chinese is "optional PHP cache". It is an effective open source cache tool for PHP and an open and free PHP opcode cache, which can be used to cache and optimize PHP code on Web servers to improve server performance.
Its goal is to provide a free, open and robust framework for caching and optimizing the intermediate code of PHP and speeding up PHP execution.
Advantages of APC
1. Stability
According to our tests on several large sites, although the performance of APC is slightly lower than that of eAccelerator under low load, APC is more stable than eAccelerator in the case of long-term operation with high traffic. If the site has a sudden false death of PHP, there is no reason for the phenomenon of 502 error, we recommend using APC.
2. Technical support
APC has developed rapidly, and it has made great progress since FACEBOOK added the update to APC, while the new version of eAccelerator is not stable and a lot of features and code have been deleted.
3. Compatibility
APC supports the PHP5.3 version well.
Installation configuration:
①: yum install php-apc
Just add extension=apc.so to the php.ini.
②: compilation and installation
Download: http://pecl.php.net/get/APC-3.1.9.tar.gz
Tar xvf apc-3.1.9.tar.gzcd apc-3.1.9#/usr/bin/phpize (tells php to load dynamically) #. / configure-enable-apc- enable-apc-mmap-with-php-config=/path/to/php/configfile (use which php to view) # make & & make install
Move apc.so to / path/to/php/extension/ and change the file permissions:
# chmod 755 apc.so
Add an apc module to the configuration file
# php-I | grep php.ini finds the php.ini file first
# vim php.iniextension_dir = ". /" extension_dir= "/ path/to/php/extension"
Write apc.so files
Extension = apc.soapc.enabled = 1apc.cache_by_default = Onapc.shm_segments = 1apc.shm_size = 128apc.ttl = 7200apc.user_ttl = 7200apc.num_files_hint = 1024apc.write_lock = Onapc.gc_ttl = 3600apc.ttl = 0apc.mmap_file_mask = / tmp/apc.xxxxxx
We combine php with Apache, and restart Apache to take effect.
In the case of a separate php-fpm, the restart of php-fpm takes effect.
You can check it in the phpinfo () function, or use the command: php-I | grep apc
Thank you for your reading, the above is the content of "what does apc refer to in php". After the study of this article, I believe you have a deeper understanding of what apc refers to in php, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 243
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.