{"id":298,"date":"2011-09-26T09:12:57","date_gmt":"2011-09-26T14:12:57","guid":{"rendered":"https:\/\/www.bodhost.com\/blog\/?p=298"},"modified":"2026-02-26T13:59:07","modified_gmt":"2026-02-26T13:59:07","slug":"alternative-php-cache-apc","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/blog\/alternative-php-cache-apc\/","title":{"rendered":"Alternative PHP Cache (APC): Boosting PHP Performance and Speed"},"content":{"rendered":"\r\n<p>The &#8220;Alternative PHP Cache&#8221; (APC) is a free and open opcode cache for PHP. It was designed to provide a free framework, open and robust for caching and optimizing PHP intermediate code. It is known that APC should normally be included alternatively in php icon wink Alternative PHP Cache.<\/p>\r\n\r\n\r\n\r\n<p>We should use it to optimize the access of portals, and it is true that improvement is really important!<\/p>\r\n\r\n\r\n\r\n<p>Here is a small how-to explaining how to install an APC on Debian with php4.<\/p>\r\n\r\n\r\n\r\n<p>First, you need to install PEAR<br \/>apt-get install apache2<br \/>apt-get install libapache2-mod-php4<br \/>apt-get install php-pear<br \/>apt-get install php4-dev<br \/>apt-get install make<br \/>pecl install apc<\/p>\r\n\r\n\r\n\r\n<p>You must install the mod pre-fork as well. Otherwise apache2-prefork-dev will show an unnecessary error, &#8220;Sorry, not able to successfully run APXS. &#8220;<\/p>\r\n\r\n\r\n\r\n<p>You must copy the file \/ usr \/ share \/ php \/ apc.php and make it available via a web interface, eg \/ var \/ www \/ htdocs \/<br \/>And you must edit the file to include a password<br \/>vi \/ var\/www\/apache2-default\/apc.php<br \/>To change this password you must change these values:<br \/>defaults (&#8216;ADMIN_USERNAME&#8217;, &#8216;user&#8217;) \/ \/ Admin Username<br \/>defaults (&#8216;ADMIN_PASSWORD&#8217;, &#8216;password&#8217;) \/ \/ Admin Password \u2013 Change to Enable this..<\/p>\r\n\r\n\r\n\r\n<p>Then you must edit the php.ini file and add this:<br \/>extension = apc.so<br \/>apc.enabled = 1<br \/>apc.shm_segments = 1<br \/>apc.shm_size = 1024<br \/>apc.max_file_size = 1024000<\/p>\r\n\r\n\r\n\r\n<p>apc.enabled enable or disable APC. It is a default<br \/>apc.shm_segments is the number of memory segments to allocate for the cache. It is a default.<br \/>apc.shm_size is the size of each shared memory segment in MB. This must be paid according to the machine&#8217;s capabilities and needs.<br \/>apc.max_file_size prevents large files from being cached.<\/p>\r\n\r\n\r\n\r\n<p>It is possible to clear the cache by authenticating and clicking on &#8216;Clear Cache opcode &#8220;<\/p>\r\n\r\n\r\n\r\n<p>And experience greatly improved performance with an alternative PHP Cache.<\/p>\r\n\r\n\r\n\r\n<p>Searching for fast, dependable, and secure hosting solutions for your expanding website? Check out our range of <a title=\"hosting solutions\" href=\"https:\/\/www.bodhost.com\/\" target=\"_blank\" rel=\"noopener\">hosting solutions<\/a>.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>The &#8220;Alternative PHP Cache&#8221; (APC) is a free and open opcode cache for PHP. It was designed to provide a free framework, open and robust for caching and optimizing PHP intermediate code. It is known that APC should normally be included alternatively in php icon wink Alternative PHP Cache. We should use it to optimize [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[91],"tags":[92],"class_list":["post-298","post","type-post","status-publish","format-standard","hentry","category-php","tag-php-cache"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/blog\/wp-json\/wp\/v2\/posts\/298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/blog\/wp-json\/wp\/v2\/comments?post=298"}],"version-history":[{"count":7,"href":"https:\/\/www.bodhost.com\/blog\/wp-json\/wp\/v2\/posts\/298\/revisions"}],"predecessor-version":[{"id":6576,"href":"https:\/\/www.bodhost.com\/blog\/wp-json\/wp\/v2\/posts\/298\/revisions\/6576"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/blog\/wp-json\/wp\/v2\/media?parent=298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/blog\/wp-json\/wp\/v2\/categories?post=298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/blog\/wp-json\/wp\/v2\/tags?post=298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}