fixyourserver.com

A lot of stuff and things…

How To: Install APC PHP Extension on cPanel and Linux Servers

Speed Up PHP
Since OPCaching options are becoming more mainstream and less experimental these days, I figured why not write a little how to. As with everything, this too has a few caveats.

  • Doesn’t work with Zend Optimizer
  • Doesn’t work with ionCube Loaders
  • Doesn’t work with SuPHP
  • Does work with FastCGI, depending on settings it’s cache will drop every few minutes
  • Works with PHP as DSO (Apache Module) and is by far the best way to utilize APC
  • On to the instructions.
    I don’t use pecl often. I’ve had issues with it disrupting other installed modules, failing because /tmp is mounted as noexec and multiple other issues, so I’ll go from source here.

    cd /usr/local/src
    wget http://pecl.php.net/get/APC-3.1.9.tgz
    tar -zxvf APC-3.1.9.tgz
    cd APC*
    phpize
    ./configure
    make
    make install
    

    At this point the extension is ready to use, but you need to tell PHP to use it. Alter your php.ini at /usr/local/lib/php.ini. Go all the way to the bottom and add

    extension=apc.so

    Next, will be settings. Since I don’t know you’re environment, I can’t give you an end-all-be-all configuration. You need to adjust settings best for your system. To get started, copy the apc.php file from the contents which you just extracted to one of the accounts public_html’s and view it in browser. You can see all of the settings and also the variables which can be adjusted.

    Next Post

    Previous Post

    Leave a Reply

    © 2017 fixyourserver.com

    Theme by Anders Norén