{"id":19,"date":"2008-04-22T23:30:40","date_gmt":"2008-04-23T05:30:40","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=19"},"modified":"2026-01-08T23:07:00","modified_gmt":"2026-01-09T05:07:00","slug":"alternative-php-cache-apc","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/alternative-php-cache-apc\/","title":{"rendered":"What is Alternative PHP Cache (APC)?"},"content":{"rendered":"<h2 data-start=\"265\" data-end=\"330\">Alternative PHP Cache (APC) \u2013 Overview and Modern Alternatives<\/h2>\n<p data-start=\"332\" data-end=\"637\">Alternative PHP Cache (APC) was an open-source PHP accelerator used to improve the performance of PHP applications. It worked by caching the compiled PHP bytecode in shared memory, which reduced the need to compile PHP scripts on every request. This helped applications run faster and reduced server load.<\/p>\n<p data-start=\"639\" data-end=\"847\">During PHP execution, scripts are first compiled into intermediate code, also known as opcodes. APC stored these opcodes in memory and reused them for future requests, almost eliminating compilation overhead.<\/p>\n<blockquote data-start=\"849\" data-end=\"1019\">\n<p data-start=\"851\" data-end=\"1019\"><strong data-start=\"851\" data-end=\"870\">Important Note:<\/strong> APC is now <strong data-start=\"882\" data-end=\"896\">deprecated<\/strong> and is no longer maintained. It does not support modern PHP versions and should not be used on current production servers.<\/p>\n<\/blockquote>\n<h2 data-start=\"1026\" data-end=\"1061\">Why APC Is No Longer Recommended ?<\/h2>\n<ul data-start=\"1063\" data-end=\"1262\">\n<li data-start=\"1063\" data-end=\"1111\">\n<p data-start=\"1065\" data-end=\"1111\">APC is incompatible with modern PHP versions<\/p>\n<\/li>\n<li data-start=\"1112\" data-end=\"1151\">\n<p data-start=\"1114\" data-end=\"1151\">The project is no longer maintained<\/p>\n<\/li>\n<li data-start=\"1152\" data-end=\"1200\">\n<p data-start=\"1154\" data-end=\"1200\">PHP introduced better and safer alternatives<\/p>\n<\/li>\n<li data-start=\"1201\" data-end=\"1262\">\n<p data-start=\"1203\" data-end=\"1262\">Modern Linux distributions no longer support APC packages<\/p>\n<\/li>\n<\/ul>\n<p data-start=\"1264\" data-end=\"1306\">APC was split into two separate solutions:<\/p>\n<ul data-start=\"1308\" data-end=\"1392\">\n<li data-start=\"1308\" data-end=\"1355\">\n<p data-start=\"1310\" data-end=\"1355\"><strong data-start=\"1310\" data-end=\"1321\">OPcache<\/strong> \u2013 for opcode (bytecode) caching<\/p>\n<\/li>\n<li data-start=\"1356\" data-end=\"1392\">\n<p data-start=\"1358\" data-end=\"1392\"><strong data-start=\"1358\" data-end=\"1366\">APCu<\/strong> \u2013 for user data caching<\/p>\n<\/li>\n<\/ul>\n<p data-start=\"1394\" data-end=\"1449\">These are now the <strong data-start=\"1412\" data-end=\"1440\">recommended replacements<\/strong> for APC.<\/p>\n<h2 data-start=\"1456\" data-end=\"1499\">Recommended Modern PHP Caching Solutions<\/h2>\n<h3 data-start=\"1501\" data-end=\"1530\">1. OPcache (Opcode Cache)<\/h3>\n<p data-start=\"1532\" data-end=\"1695\">OPcache is built into PHP and is enabled by default on most systems. It stores precompiled script bytecode in shared memory and significantly improves performance.<\/p>\n<h4 data-start=\"1697\" data-end=\"1716\">Enable OPcache<\/h4>\n<p data-start=\"1718\" data-end=\"1743\">Edit your <strong>php.ini<\/strong> file:<\/p>\n<div class=\"contain-inline-size rounded-2xl corner-superellipse\/1.1 relative bg-token-sidebar-surface-primary\">\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><em><strong>zend_extension=opcache.so<\/strong><\/em><\/div>\n<\/div>\n<p data-start=\"1783\" data-end=\"1824\">Restart your web server and verify using:<\/p>\n<div class=\"contain-inline-size rounded-2xl corner-superellipse\/1.1 relative bg-token-sidebar-surface-primary\">\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><em><strong>php -v<\/strong><\/em><\/div>\n<\/div>\n<p data-start=\"1845\" data-end=\"1893\">or check the <strong data-start=\"1858\" data-end=\"1877\">OPcache section<\/strong> in <strong>phpinfo()<\/strong>.<\/p>\n<h3 data-start=\"1900\" data-end=\"1924\">2. APCu (User Cache)<\/h3>\n<p data-start=\"1926\" data-end=\"2019\">APCu provides in-memory caching for application data such as variables, objects, and results.<\/p>\n<h4 data-start=\"2021\" data-end=\"2049\">Install APCu using PECL<\/h4>\n<div class=\"contain-inline-size rounded-2xl corner-superellipse\/1.1 relative bg-token-sidebar-surface-primary\">\n<div class=\"sticky top-[calc(--spacing(9)+var(--header-height))] @w-xl\/main:top-9\">\n<div class=\"absolute end-0 bottom-0 flex h-9 items-center pe-2\">\n<div class=\"bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs\"><em><strong>pecl install apcu<\/strong><\/em><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p data-start=\"2082\" data-end=\"2118\">Add the following line to <strong>php.ini <\/strong>:<\/p>\n<p data-start=\"2082\" data-end=\"2118\"><em style=\"font-size: revert;\"><strong>extension=apcu.so<\/strong><\/em><\/p>\n<p data-start=\"2082\" data-end=\"2118\">Restart the web server to apply changes.<\/p>\n<h2 data-start=\"2197\" data-end=\"2262\">Legacy Information: Installing APC (For Old PHP Versions Only)<\/h2>\n<blockquote data-start=\"2264\" data-end=\"2363\">\n<p data-start=\"2266\" data-end=\"2363\">Use this section <strong data-start=\"2283\" data-end=\"2329\">only for documentation or very old systems<\/strong> running unsupported PHP versions.<\/p>\n<\/blockquote>\n<h3 data-start=\"2365\" data-end=\"2411\">Basic Legacy Steps (Not Recommended Today)<\/h3>\n<ol data-start=\"2413\" data-end=\"2596\">\n<li data-start=\"2413\" data-end=\"2440\">\n<p data-start=\"2416\" data-end=\"2440\">Download APC from PECL<\/p>\n<\/li>\n<li data-start=\"2441\" data-end=\"2472\">\n<p data-start=\"2444\" data-end=\"2472\">Extract the source archive<\/p>\n<\/li>\n<li data-start=\"2473\" data-end=\"2490\">\n<p data-start=\"2476\" data-end=\"2490\">Run <strong>phpize<\/strong><\/p>\n<\/li>\n<li data-start=\"2491\" data-end=\"2527\">\n<p data-start=\"2494\" data-end=\"2527\">Configure, compile, and install<\/p>\n<\/li>\n<li data-start=\"2528\" data-end=\"2568\">\n<p data-start=\"2531\" data-end=\"2568\">Add <strong>extension=apc.so<\/strong> to<strong> php.ini<\/strong><\/p>\n<\/li>\n<li data-start=\"2569\" data-end=\"2596\">\n<p data-start=\"2572\" data-end=\"2596\">Restart the web server<\/p>\n<\/li>\n<\/ol>\n<blockquote data-start=\"2598\" data-end=\"2670\">\n<p data-start=\"2600\" data-end=\"2670\">These steps are <strong data-start=\"2616\" data-end=\"2628\">obsolete<\/strong> and should not be used on modern systems.<\/p>\n<\/blockquote>\n<h2 data-start=\"2677\" data-end=\"2705\">How to Verify PHP Caching<\/h2>\n<p data-start=\"2707\" data-end=\"2738\">After enabling OPcache or APCu :<\/p>\n<p data-start=\"2707\" data-end=\"2738\"><strong style=\"font-size: revert;\">phpinfo()<\/strong><\/p>\n<p data-start=\"2763\" data-end=\"2772\">Look for:<\/p>\n<ul data-start=\"2773\" data-end=\"2833\">\n<li data-start=\"2773\" data-end=\"2799\">\n<p data-start=\"2775\" data-end=\"2799\"><strong data-start=\"2775\" data-end=\"2791\">Zend OPcache<\/strong> section<\/p>\n<\/li>\n<li data-start=\"2800\" data-end=\"2833\">\n<p data-start=\"2802\" data-end=\"2833\"><strong data-start=\"2802\" data-end=\"2810\">APCu<\/strong> section (if installed)<\/p>\n<\/li>\n<\/ul>\n<h2 data-start=\"2840\" data-end=\"2853\">Conclusion<\/h2>\n<p data-start=\"2855\" data-end=\"3129\">APC played an important role in improving PHP performance in the past, but it is now outdated and unsupported. Modern PHP environments should always use <strong data-start=\"3008\" data-end=\"3038\">OPcache for opcode caching<\/strong> and <strong data-start=\"3043\" data-end=\"3073\">APCu for user data caching<\/strong> to achieve better performance, stability, and security.<\/p>\n<p>If you require help, c<a href=\"https:\/\/www.supportpro.com\/requestquote.php\">ontact SupportPRO Server Admin<\/a><\/p>\n<p style=\"text-align: center;\"><!--HubSpot Call-to-Action Code --><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><!-- [if lte IE 8]><\/p>\n\n\n\n\n\n<div id=\"hs-cta-ie-element\"><\/div>\n\n\n<![endif]--><a href=\"https:\/\/www.supportpro.com\/freecheckup.php\"><img decoding=\"async\" id=\"hs-cta-img-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-img\" style=\"border-width: 0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b.png\" alt=\"Server not running properly? Get A FREE Server Checkup By Expert Server Admins - $125 Value\" \/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '9d590242-d641-4383-94b4-8cfd62f0af6b', {}); <\/script><\/span><!-- end HubSpot Call-to-Action Code --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Alternative PHP Cache (APC) \u2013 Overview and Modern Alternatives Alternative PHP Cache (APC) was an open-source PHP accelerator used to improve the performance of PHP applications. It worked by caching&hellip;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[3],"tags":[],"class_list":["post-19","post","type-post","status-publish","format-standard","hentry","category-technical-articles"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/19","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=19"}],"version-history":[{"count":10,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/19\/revisions"}],"predecessor-version":[{"id":15177,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/19\/revisions\/15177"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=19"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=19"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}