APC
From DreamHost
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. |
Installing
- Grab the source code: wget http://pecl.php.net/get/APC-3.1.9.tgz (or whatever the latest version is!)
- Unpack the download: tar xvf APC-3.1.9.tgz
- Go the unpacked download: cd APC-3.1.9
- Run phpize (PHP 5.3 domains: /usr/local/php53/bin/phpize)
- ./configure; make (for PHP 5.3 domains: ./configure --with-php-config=/usr/local/php53/bin/php-config; make)
- Copy modules/apc.so from the APC directory somewhere else.
- Setup a custom PHP.ini.
- 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.
- 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).
- 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).
- APC is now installed and available for use. (To check, create a php file that calls phpinfo();, visit the file, and check for "apc".)
- 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.