PHP may be the most popular website building language for Linux developers and a language available to programmers on other platforms. PHP is fully supported, fast and flexible.
However, PHP has a defect. Because PHP is a scripting language, it can be edited before executing any specific idle and mixed script. However, most modern systems can do this quickly, so it is always a good thing to get the best performance that stands out in the network.
Alternative PHP Cache (APC) is an open-source high-speed buffer storage tool for PHP, which can hide edited scripts. Therefore, if the subsequent command has changed, PHP can only re-edit the script.
However, this can only result in obtaining the optimum performance on some scripts, and it makes more sense for more complex scripts. Unlike some of its competitors, APC is an open source and widely used. You can download the source code from the APC website.
Free commercial versions are also available: Zend optimizers of Zend. (Zend is the company that compiles the engine PHP and edits the script.) However, the results of the independent report published by APC are more meaningful than those of Zend optimizers.
It is very convenient to install APC. Once you download the APC source code, you do not need to configure it to work outside the box. The latest version is 2.0.4. Perform the following operations to install APC:
# Tar xvzf APC-2.0.3.tgz
# Cd APC-2.0.3
#/Usr/bin/phpize
#./Configure -- enable-apc
# Make
# Make install
If your PHP installation is not in/usr, you must call up phpize from the bin/directory under your installation directory. for example, if you have installed php in/usr/local/PHP, You need to execute/usr/local/php/bin/phpize.
Next, use a text editing software to edit the php. ini file (usually/etc/php. ini) and add the following content to the end:
Extension = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20050922/apc. so"
Save the file and restart Apache. Then, create a file named info. php somewhere in your network tree, including:
<? Php phpinfo ();?>
Open this page in your browser. You will see a part of APC in the output. Now you can use APC to accelerate your PHP script.