Using Ubuntu server 10.4, I apt-getted php-apc

Where is the apc.php file that I'm meant to copy?


7 Answers 7


Accourding to the packages.ubuntu.com page about php-apc the file can be found compressed here /usr/share/doc/php-apc/apc.php.gz.

If you don't want do look online you can query the list of files installed by the package managment system by using a command like dpkg -L apc.php.

  • Anyone can share the code for that apc.php file instead? Dotdeb does not seem to have included that file in their package. Commented Apr 26, 2013 at 0:46
  • @WearetheWorld, you could always download a .deb file that does include that, and simply extract the files from .deb. See serverfault.com/a/88522/984 A .deb is an ar archive that usually conatains a couple tar.gz files.
    – Zoredache
    Commented Apr 26, 2013 at 0:52
  • Yeah that's what I did haha! Commented Apr 26, 2013 at 2:22
  • On Ubuntu i had to use dpkg -L php-apc.
    – DanMan
    Commented Jul 17, 2013 at 14:20
  • Note that for php5.5 the lib is APCU therefore the path is: /usr/share/doc/php5-apcu
    – COil
    Commented Jun 9, 2015 at 13:34

find / -name apc.php* 2>/dev/null

"Find, within /, resources matching apc.php*, and discard stderr."

E.g. this may return /build/buildd/php5-5.3.2/pear-build-download/APC-3.0.19/apc.php

  • 1
    I fail to see the sense to piping the output of find to grep in this instance, since find will only return names that contain the searched-for string.
    – tylerl
    Commented Jul 31, 2010 at 8:01
  • 4
    Otherwise there's "Permission denied" for files that you cannot read.
    – Ben
    Commented Aug 3, 2010 at 23:21
  • 2
    This doesn't work for Ubuntu where apc.php comes gzipped. though find / -name 'apc.php*' would have. Commented Apr 13, 2011 at 15:32
  • Where permissions errors are sent to STDERR, use find / -name apc.php* 2>/dev/null
    – Steve Clay
    Commented Jul 12, 2012 at 21:12
  • ...or you could always run find with sudo and there'd be no need to bother with the whole dev/null malarkey. Commented Jul 7, 2014 at 14:19

I came here looking for this file after installing APC on CentOS with PEAR. After tracking it down with Ben's find suggestion, I thought I'd post its path in case others end up here:


From the README.Debian

  1. Viewing statistics and tunning your cache

APC come with a script called apc.php. This script provides detailed information about your cache. In Debian this script is in /usr/share/doc/php-apc. Copy or symlink the file to your docrot and access it with you browser. If you install the php5-gd package you will also be present with graphics. In order to understand the information and use it to tune you cache refer to the APC documentation at: http://php.net/apc

-- Pietro Ferrari Wed, 17 Dec 2008 11:23:39 -0500

This file was located in /usr/share/doc/php-apc


If nothing else works, you can download it directly from PECL by hand:

cd /tmp
wget http://pecl.php.net/get/APCu -O - | tar xz --wildcards apcu*/apc.php
mv apcu*/apc.php apc.php
rm -r apcu*/
# mv apc.php /wherever/you/want/apc.php
  • No longer works right, they started to rename APC things to APCu
    – ParoX
    Commented Jan 6, 2015 at 15:12
  • @ParoX yep, I patched mine by hand but it's currently crashing again, not very realiable at the moment unfortunately.
    – Mahn
    Commented Jan 6, 2015 at 15:18
  • Thank you. On Godaddy's CentOS virtual hosts this was the only way it worked. Commented Feb 28, 2016 at 23:04

You can get it here for apcu https://raw.githubusercontent.com/krakjoe/apcu/master/apc.php You can also look through the repo here https://github.com/krakjoe/apcu


You may consider this as a replacement for apc.php.


You must log in to answer this question.