Installing APC. Use pecl or apt-get?

Solution 1:

It depends on if you want to manage upgrades with apt-get or pecl. Either way there's no real benefit to one vs the other.

Solution 2:

The difference is that PECL will provide you with a newer version of APC.

  • PECL will install the latest released version, 3.1.13 at the time of this writing
  • APT will install 3.1.7 on 12.04 LTS

See the differences on the changelog: http://pecl.php.net/package-changelog.php?package=APC&release=3.1.7

All in all:

  • If you don't care too much about the version, use APT since it's easier to maintain
  • If you need some of the most recent features or fix, use PECL

Solution 3:

"PECL is a repository for PHP Extensions, providing a directory of all known extensions and hosting facilities for downloading and development of PHP extensions."1 PECL comes with the php-pear package.

To install the APC,

Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below.

sudo apt-get install php-apc

Note: On newer releases of Ubuntu, APC is available from the package manager; however if using older Ubuntu release and you can't find an apc-php package. You can the install via PECL, but some dependencies need to be installed, then PECL can be used to install APC.

1"What is PECL?"