{"id":340,"date":"2011-07-03T09:48:25","date_gmt":"2011-07-03T09:48:25","guid":{"rendered":"http:\/\/hgtas.com\/?p=340"},"modified":"2011-07-03T09:48:25","modified_gmt":"2011-07-03T09:48:25","slug":"installing-php-apc-on-gnulinux-centos-5","status":"publish","type":"post","link":"https:\/\/508.me\/?p=340","title":{"rendered":"Installing PHP APC on GNU\/Linux Centos 5"},"content":{"rendered":"<p>Complex PHP applications, such as Drupal, can gain a lot of performance benefits from running <a href=\"http:\/\/2bits.com\/articles\/php-op-code-caches-accelerators-a-must-for-a-large-site.html\" target=\"_blank\">a PHP op-code cache\/accelerators<\/a>.<\/p>\n<p>APC,<br \/>\nAlternate PHP Cache, is now the most maintained free\/open source op-code  cache, and is being used more and more as it emerges to be the<br \/>\nmost stable.<\/p>\n<p>The instructions here detail how to get APC running on a CentOS 5  server. The server happened to have Plesk on it as well, which initially  made me hesitant to install APC &#8220;normally&#8221;, since Plesk is so picky on  what other software is installed on the server. However, it seems to  have worked out well.<\/p>\n<p>First, we need the <strong>pecl<\/strong> command so we can download and install APC from the repositories.<\/p>\n<p>Do to so, we execute the following command:<\/p>\n<pre>yum install php-pear<\/pre>\n<p>But, this will not run on its own, we need the following package for the <strong>phpize<\/strong> command:<\/p>\n<pre>yum install php-devel<\/pre>\n<p>We also need the <strong>apxs<\/strong> command, which is installed via the following package:<\/p>\n<pre>yum install httpd-devel<\/pre>\n<p>Now we have all the software we need, so we install apc via the pecl command:<\/p>\n<pre>pecl install apc<\/pre>\n<p>Once that finishes, we need to enable apc in Apache&#8217;s configuration. the following command should do this for us.<\/p>\n<pre>echo \"extension=apc.so\" &gt; \/etc\/php.d\/apc.ini<\/pre>\n<p>Then we restart Apache:<\/p>\n<pre>\/etc\/init.d\/httpd start<\/pre>\n<p>And we are all done. Watch for less execution time per page, and  decreased memory usage per Apache process compared to what you had<br \/>\nbefore.<\/p>\n<h2>Links<\/h2>\n<p>You can find some additional tips at <a href=\"http:\/\/centoshacker.com\/kabir\/performance\/setting-up-alternative-php-caching-apc-support-on-centos-server.html\">Setting up Alternative PHP Caching APC support on Centos server<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/2bits.com\/articles\/installing-php-apc-gnulinux-centos-5.html\" target=\"_blank\">http:\/\/2bits.com\/articles\/installing-php-apc-gnulinux-centos-5.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Complex PHP applications, such as Drupal, can gain a lo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[105,38,140],"_links":{"self":[{"href":"https:\/\/508.me\/index.php?rest_route=\/wp\/v2\/posts\/340"}],"collection":[{"href":"https:\/\/508.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/508.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/508.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/508.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=340"}],"version-history":[{"count":2,"href":"https:\/\/508.me\/index.php?rest_route=\/wp\/v2\/posts\/340\/revisions"}],"predecessor-version":[{"id":342,"href":"https:\/\/508.me\/index.php?rest_route=\/wp\/v2\/posts\/340\/revisions\/342"}],"wp:attachment":[{"href":"https:\/\/508.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/508.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/508.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}