As you know, each time php script is executed, PHP interpreter need to compile it first to bytecode and only after that - execute. That compilation takes much time.
APC PHP extension (which will be included and enabled in PHP6 by default. It becomes a standard) can speedup php script execution process by caching once compiled PHP bytecode in memory. So, installing this extension increases your server performance. To install extension just do the following:
- cd usr/local
- mkdir apc
- cd apc
- wget http://pecl.php.net/get/APC
After issuing the last command you will have an archive with latest APC source downloaded to your current directory. At the time of writting this article it is APC-3.0.16.tgz. Let's proceed with unpacking it.
- tar -zxvf APC-3.0.16.tgz
- cd APC-3.0.16
- phpize
- ./configure
- make
- make install
Now locate your php.ini and open it with your default editor. Add anywhere (at the very end for example) the following line:
- service httpd restartCode:extension=apc.so
Now apc extension should be loaded together with your PHP. To test if it is, just take apc.php file from your installation and put it to the directory accessible by your webserver. Open URL in browser and check how your APC is working for you.



LinkBack URL
About LinkBacks
Reply With Quote




