APC

From DreamHost
(Redirected from Pecl APC)
Jump to: navigation, search

APC is a PHP cache. It will work under both shared and PS environments, but we recommend that you use DreamHost PS (testing on DreamHost PS with a semi-large MediaWiki install increased php's resource usage to 55M).

The instructions provided in this article or section are considered advanced.

You are expected to be knowledgeable in the UNIX shell.
Support for these instructions is not available from DreamHost tech support.
Server changes may cause this to break. Be prepared to troubleshoot this yourself if this happens.
We seriously aren't kidding about this.

Installing

  1. Grab the source code: wget http://pecl.php.net/get/APC-3.1.9.tgz (or whatever the latest version is!)
  2. Unpack the download: tar xvf APC-3.1.9.tgz
  3. Go the unpacked download: cd APC-3.1.9
  4. Run phpize (PHP 5.3 domains: /usr/local/php53/bin/phpize)
  5. ./configure; make (for PHP 5.3 domains: ./configure --with-php-config=/usr/local/php53/bin/php-config; make)
  6. Copy modules/apc.so from the APC directory somewhere else.
  7. Setup a custom PHP.ini.
  8. Add the line extension = /home/YOURUSER/WHERE/APC/IS/apc.so to the custom php.ini along with any other APC config lines you need.
  9. Run ps x to see if any php5.cgi or php53.cgi processes are running that need to be ended (existing PHP processes will not recognize APC until they are restarted).
  10. If there are PHP processes to end, and you DON'T use FastCGI, run killall php5.cgi; killall php53.cgi (if you DO use FastCGI, do not use killall right away! See Pecl APC#Troubleshooting APC (first question) for instructions on killing existing FastCGI PHP processes).
  11. APC is now installed and available for use. (To check, create a php file that calls phpinfo();, visit the file, and check for "apc".)
  12. To make sure APC is working on your site, copy apc.php from your unpacked download folder to a location on your site visible from the internet. Then simply go to the apc.php page from any web browser to see the reports.
Personal tools