|
|
|||
OPTIMIZE PHP WITH APC PHP is perhaps the most popular language for Web site development among Linux developers and arguably for developers on other platforms as well. PHP is well-supported, fast, and very flexible. However, PHP does have one drawback. Because PHP is a scripting language, it therefore compiles any given script on the fly prior to executing it. But while most modern systems can do this quickly, obtaining the most performance one can squeeze out of Web services is always a good thing. Alternative PHP Cache (APC) is an open source caching tool available for PHP, which caches compiled scripts. So on subsequent calls, PHP only has to recompile the script if it has changed. While this can lead to only a modest performance gain on some scripts, it can lead to a fairly significant increase on more complex scripts. Unlike some of its competitors, APC is open source and freely available. You can download the source code from the APC Web site. http://pecl.php.net/package/APC A free commercial offering is also available: Zend Optimizer from Zend. (Zend is the company that wrote the engine PHP uses to compile scripts.) However, independent reports have shown that APC's gains over Zend Optimizer's can be fairly significant. http://www.zend.com/store/products/zend-optimizer.php Installing APC is a snap; there's nothing to configure to make it work "out of the box." Just download the APC source code; the latest version is 2.0.4. To install APC, execute the following: # tar xvzf
APC-2.0.3.tgz Next, use a text editor to edit the php.ini file (usually /etc/php.ini), and add the following to the bottom: extension=apc.so <?php
phpinfo(); ?> |
||||