APC (Alternative PHP Cache)

Requests for RPMS, or new coding projects related to server administration, Plesk, security, or anything else you can think of.
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

APC (Alternative PHP Cache)

Unread post by breun »

I haven't been happy with PHP eAccelerator (problems with Horde, Apache segfaults, etc.) and I have been replacing it with APC (Alternative PHP Cache) on a couple of machines. I read this opcode cache will be the default opcode cache in PHP 6. Could you package this for the atomic repository?

Here is what I did to manually install APC:
Requirements according to the site:
* PHP >= 4.3.0
* PEAR >= 1.4.0

Automatic compile and install using yum and pecl

Make sure you have /usr/bin/pecl:
# yum install php-pear

Make sure you have a C++ compiler:
# yum install gcc-c++

Make sure you have /usr/sbin/apxs:
# yum install httpd-devel

Note sure, is re2c needed? Pecl put up a warning when it was not available:
# yum install re2c

PECL does the rest:
# pecl install APC

Skip to 'Using APC' below for configuration.

Manual installation (untested)

This uses the phpize command from php-devel.

Download the latest version:
# wget http://pecl.php.net/get/APC

Download a specific version, untar, make and install:
$ wget http://pecl.php.net/get/APC-3.0.19.tgz
$ tar zxvf APC-3.0.19.tgz
$ cd APC-3.0.19
$ ./configure
$ make
# make install

Using APC

Load the extension:
# echo "extension=apc.so" > /etc/php.d/apc.ini

Runtime configuration (use all defaults):
# echo "# See http://www.php.net/manual/en/apc.configuration.php for APC configuration directives." > /etc/httpd/conf.d/apc.conf

Reload Apache:
# service httpd reload
Lemonbit Internet Dedicated Server Management
Post Reply