# Login to the server as root
# Download APC
eg : wget http://pecl.php.net/get/APC-3.0.15.tgz
# Extract it and move into the directory
- Code: Select all
tar -xzf APC-3.0.15.tgz
cd APC*
# Locate where php is
- Code: Select all
which php
This should return something like: /usr/local/bin/php Remember the location of php.
# Create configuration files
- Code: Select all
phpize
# Compile APC
- Code: Select all
./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/local/bin/php-config
make
make install
# Install APC into php.ini
You will have to first locate php.ini using the following command
- Code: Select all
php -i | grep php.ini
This will usually return /usr/local/Zend/etc/php.ini on a server that has Zend optimizer installed. Now edit php.ini and add the APC extension.
- Code: Select all
vi /usr/local/Zend/etc/php.ini
Scroll down to the bottom and add the fallowing before the lines about the zend optimizer (They start with [Zend])
- Code: Select all
extension=”/apc_location/apc.so”
# Restart Apache
- Code: Select all
service httpd restart

