Install APC (Alternative PHP Cache)

This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.


24 points

I'm about to install APC on a dedicated server running Debian (though using Lighttpd instead of Apache).

Any particular difference between apt-get and its newer and better successor, aptitude?



8 points

Regarding apt-get vs. aptitude, it is just a matter of preference. They both do the same thing, but from a different interface.

Anonymous's picture
Created by Anonymous
-8 points

Installing APC. First, we run apt-get to get what we need, if it is already not there.

apt-get update
apt-get install apache2-dev php5-dev php-pear make 

I am using Apache2 and PHP5 on the development server. Adjust the versions above if necessary to match your environment.

Since I am using Apache2, the apxs is named differently, and pecl will fail if I do not work around this. So, I had to provide an apxs which is just a symbolic link.

ln -s /usr/bin/apxs2 /usr/bin/apxs

Next we use pecl to download, compile and install APC.

pecl install apc

Now, I am getting a strange problem running the above pecl command, with an error saying:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 143 bytes) in /usr/share/php/PEAR/PackageFile/v2.php on line 1772

The solution is:

Edit the /usr/share/php/pearcmd.php, and add:

@ini_set('memory_limit', '16M');

Anonymous's picture
Created by Anonymous

Post Comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.