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:
- Your server has Fedora Core 7 or Centos 5.x or above and at least
PHP 5.1.6
- You have a PHP/MySQL driven page
- You are experiencing performance lag and have already done
performance tuning of MySQL
Getting
Started:
- Log into your server using SSH
- 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 | |
- 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 | |
- 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:
|
- You will now need to restart the web server with the following
command:
| |
| [root@hostname]#/usr/local/psa/admin/bin/websrvmng
-av | |
- 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 | |
- 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.