Installing PHP APC On RHEL/CentOS

  1. Yum up some packages:
    yum install php-pear php-devel httpd-devel
  2. Install APC using pear (the pear installer is smarter than the pecl installer):
    When the installer asks about APXS, say ‘no’. 

    pear install pecl/apc
  3. Tell PHP to load APC:
    echo extension=apc.so > /etc/php.d/apc.ini
  4. Restart Apache:
    /sbin/service httpd graceful

10 Comments

  1. Thanks. Very simple, very clear, very complete directions. Are you sure you are a linux guy? They are going to revoke your group membership privileges if you don’t make these directions either partially incomplete or somewhat arcane.

  2. @Mark:

    Thanks, but don’t worry for me. These directions will become incomplete and misleading as soon as the underlying OS changes.

  3. Many thanks. I agree with Mark. After seeing so many ridiculously complicated explanations of the above simple process I can only say again – thank you for you help and effort.

  4. [...] Casey actually has some instructions that provide a more elegant method of installing APC on CentOS or [...]

  5. Hi Casey,
    Can you explain why you choose “no” for APXS?

    Thanks,
    -mike

  6. Thanks for this!

  7. Very clear.
    Good job.

  8. @Mike: Because there had to be at least one unexplained, obscure thing in a Linux related post?

    Casey, I’d love to know the answer to Mike’s question as well. Did testing having answered ‘yes’ reveal subtle weirdness? Did things blow up spectacularly? Or does that let you avoid pulling in httpd-devel and all the compiler-related dependencies that that brings in?

    Cheers (and add my thanks to the list!),

    Justin

    • @Justin:

      My first few tries were with APXS, but they failed (can’t remember errors). It didn’t blow up so bad that I couldn’t try again, it just didn’t work.

  9. I had to add the line below to my php.ini to get APC to load on RHEL with PHP 5.2.

    apc.rfc1867 = 1


Comments RSS TrackBack Identifier URI

Leave a comment

 

User contributed tags for this post:

apc centos (202) - yum apc (170) - centos apc (112) - php apc install (106) - install APC centos (92) - php apc rpm (91) - centos php apc (90) - centos install apc (80) - install php apc (75) - php apc centos (67) - apxs centos (47) - php-apc rpm (44) - apc install (39) - apc rpm (38) - pear install APC (36) - yum install apc (36) - installing apc centos (35) - centos apc install (34) - apc php centos (32) - apc yum (29) - pecl install apc (29) - apc apxs (27) - install apc on centos (27) - yum install json (26) - centos apxs (26) - install apxs centos (25) - php apc (24) - pear apc install (24) - php-apc centos (23) - php apc rhel (22) - install apc php (22) - centos install php apc (22) - PECL rhel (21) - APC RHEL (21) - rhel pecl (20) - yum install php json (20) - rhel apc (20) - centos install apxs (20) - centos APC rpm (20) - yum json (19) - yum install pecl (19) - rhel php apc (19) - php install apc (19) - php apc redhat (19) - install apc redhat (19) - yum install php-json (18) - rhel install APC (18) - pecl install apc apxs (18) - centos php json (17) - yum install php-apc (17) - install apc (17) - No package httpd-devel available. (17) - Installing PHP APC (17) - php json centos (16) - install php apc centos (16) - redhat php apc (16) - yum php json (15) - yum install apxs (15) - no package httpd-devel available (15) - install apc rhel (14) - installing pear on centos (14) - yum install php apc (14) - centos php apc install (14) - json centos (13) - centos php-json (13) - APC install centos (13) - RHEL apxs (13) - centos apc php (13) - installing APC on centos (13) - pear centos (12) - apxs centos 5 (12) - how to install php apc (12) - install php-apc (11) - apxs apc (11) - centos php-apc (11) - yum php apc (11) - centos json (10) - php-json centos (10) - centos 5 php json (10) - centos php (10) - yum php-apc (10) - rhel5 php apc (10) - install pear centos (10) - apc php rpm (10) - php apc installation (10) - install apc pear (10) - APC rpm centos (10) - apc centos rpm (10) - yum php-json (9) - json centos 5 (9) - yum install json php (9) - json php centos (9) - install apc centos 5 (9) - installing apc in centos (9) - install apc php centos (9) - json php-devel (9) - php-json centos 5 (8) - centos apc yum (8) - centos yum apc (8) - APC rhel5 (8) - centos install pear (8) - install apc with pear (8) - pecl apc apxs (8) - centos 5 install apxs (8) - apc on centos (8) - centos 5 php apc (8) - install apxs centos 5 (8) - how to install apc (8) - redhat install apc (8) - install json centos (7) - rhel apc php (7) - php apc centos 5 (7) - install apc yum (7) - installing pear centos (7) - install apc for php (7) - install apc centos 4 (7) - centos install php-apc (7) - how to install apc centos (7) - centos php apc rpm (7) - install PHP Centos (6) - json rhel (6) - RHEL php (6) - pecl json centos (6) - centos install json (6) - yum install pear (6) - yum apc centos (6) - pecl install apc rhel (6) - APC PHP RHEL (6) - how to install apc on centos (6) - download php for centos (6) - install php on centos (6) - centos install php (6) - php apc pecl (6) - RHEL5 yum install php-JSON (6) - php-apc rpm centos (6) - install php apc on centos (6) - php apc on centos (6) - pear apc (6) - centos 4 apc (6) - apc php redhat (6) - Centos (5) - php json centos 5 (5) - rhel php json (5) - rhel json (5) - centos install php json (5) - php-apc (5) - php apc apxs (5) - apxs in centos (5) - pecl apxs (5) -