How do I install APC Advanced php caching on my linux server?

Important Notes:
APC is a PHP module that creates a cache for PHP files called by Apache.  You will want to install APC if you are having the following issues:
  1. Your server has Fedora Core 7 or Centos 5.x or above and at least PHP 5.1.6
  2. You have a PHP/MySQL driven page
  3. You are experiencing performance lag and have already done performance tuning of MySQL
Getting Started:
  1. Log into your server using SSH

  2. Once you have connected to the server you are going to run the following commands:



    [root@hostname]#yum install php-pear

    [root@hostname]#yum install php-devel

    [root@hostname]#yum install httpd-devel

    [root@hostname]#pecl install apc

  3. Now APC is installed, we just need to enable it on the domain(s) that require APC.  To do this, we need to copy apc.php from /usr/share/php/ to the httpdocs directory of the domain that needs APC.  Use the following command:

     
    [root@hostname]#cp /usr/share/php/apc.php /var/www/vhosts/DOMAINNAME.COM/httpdocs
  4. Now we need to create a file so PHP knows that APC is installed.  Issue the following command:

     
    [root@hostname]#vi /etc/php.d/apc.ini

    then insert the following line into the text document:

    extension=apc.so

  5. You will now need to restart the web server with the following command:

     
    [root@hostname]#/usr/local/psa/admin/bin/websrvmng -av
  6. Finally, you need to copy the file to the root of the domain that requires APC:

     
    [root@hostname]#cp /usr/share/php/apc.php /var/www/vhosts/DOMAINNAME.COM/httpdocs
  7. You can now test to see if APC is installed by going to http://DOMAINNAME.COM/apc.php


Related Articles

No related articles were found.

Attachments

No attachments were found.

Visitor Comments

No visitor comments posted. Post a comment

Post Comment for "How do I install APC Advanced php caching on my linux server?"

To post a comment for this article, simply complete the form below. Fields marked with an asterisk are required.

   Name:
   Email:
* Comment:
* Enter the code below:

 

Article Details

Last Updated
16th of June, 2009

See also:
Troubleshooting your server.

Would you like to...

Print this page  Print this page

Email this page  Email this page

Post a comment  Post a comment

 Subscribe me

Subscribe me  Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF


User Opinions

No users have voted.

How would you rate this answer?




Thank you for rating this answer.

Continue