Install APC (Alternative PHP Cache)

7 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?

Created by Anonymous 21 weeks 4 days ago
  Tags:

Answer(s):

6 points

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

Created by Anonymous
0 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');

Created by Anonymous

Post your Answer

  • Lines and paragraphs break automatically.
  • 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 <% ... %>.
  • Links to specified hosts will have a rel="nofollow" added to them.

More information about formatting options