How to set up Alternative PHP Cache in PHP5

On November 8, 2010, in Apache, by mike

In this tutorial we will integrate APC (Alternative PHP Cache) into PHP5 on a Fedora 13 system (with Apache2).

Step 1

  • To check PHP5, we create the file info.php in our document root /var/www/html:

pico /var/www/html/info.php

  • After this we call that file in a browser: http://192.168.10.10/info.php

  • We have PHP 5.3.2 installed without APC installed.

Step 2

  • Check if you have another PHP opcode cacher such as eAccelerator installed.
    • Remove it before you install APC:

yum remove php-eaccelerator

/etc/init.d/httpd restart

Step 3

  • APC is a PHP extension, this can be installed as follows:

yum install php-pecl-apc

Note: After APC is installed, check configuration file /etc/php.d/apc.ini.
The default settings should be ok, but in case you want to change anything, you can find a list of all available configuration options on http://de2.php.net/manual/en/apc.configuration.php.

pico /etc/php.d/apc.ini

Restart apache:

/etc/init.d/httpd restart

Open info.php again in a browser: http://192.168.10.10/info.php

Tagged with:  

Leave a Reply

WordPress主题

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Copyright © 2005-2010 Linux Server™. Use of this web site constitutes acceptance of the Linux Server™ Terms of Use and Privacy Policy. en-US Linux is a trademark registered by Linus Torvalds in the United States and other countries.