How to install APC and php4-memcache extension on Debian Sarge

To improve the PHP performance, I started playing with APC (Alternative PHP Cache) and memcached recently. However, to install the APC extension and PHP-Memcache client on Debian Sarge turned out to be not that trivial. Here I’d like to share my experience. It serves as my own personal record as well.
First of all, you need to have PHP4-dev and Pear package installed on your system:

apt-get install php4-pear php4-dev

In order to use the ‘pecl’ installation tool, you need to upgrade the bundled PEAR version to the latest:

pear upgrade pear-1.3.3
pear upgrade Archive_Tar
pear upgrade Structures_Graph
pear upgrade pear
pear upgrade-all

After the upgrade, you need one more step before proceeding with the pecl installation. If you don’t do the following you will have the error like this when compiling php-memcache: (configure: error: Cannot find php_session.h). Thanks to this post, I found the solution: you need to create the following symoblic link:

ln -s /usr/include/php4 /usr/include/php

Okay, final step is easy:

pecl install apc memcache

For APC, you may just choose not to compile with aspx-support, if it prompted you to select.

Now sit back, and wait for the compilation to finish. After it is done, you just need to enable the modules in your PHP.ini configuration file, which I am not going to touch upon here.

Good luck with your optimization for PHP code.

7 Responses to “How to install APC and php4-memcache extension on Debian Sarge”

  1. sushi las condes Says:

    Hi! Someone in my Facebook group shared this site with us so I came to check it out. I’m definitely loving the information. I’m book-marking and will be tweeting this to my followers! Great blog and great style and design.

  2. sushi santiago centro Says:

    I am sure you had a few experience about handling smart comment spam. I love to hear from you and of course, your comments will definitely add value to this post.

  3. Comida a domicilio Says:

    hey there is another online art aap. its a free online photoshop. you might considering looking at blastingart.com and its free to i really liked it

  4. David Mintz Says:

    I was also trying to complete the procedure after bundle pear version but after installation didn’t proceed the next steps so can’t complete the installation.
    but your article complete my problem, i really appreciate with your work its really helpful to me and others to because most of the people are having same problem.

  5. Payday Laons Says:

    One of me best friend tell me about this site for getting so much information php is one of the most difficult language for lean not possible but you are explaining here very well and its easy to understand.. Thank you so much for complete my problems..

  6. Masajistas Says:

    It’s going to be ending of mine day, however before finish I am reading
    this great post to improve my experience.

  7. casino Says:

    hi!,I like your writing very much! proportion we keep in touch extra approximately
    your post on AOL? I need a specialist on this house to resolve my problem.
    May be that’s you! Looking forward to peer you.

Leave a Reply