Here are some instructions on how install APC on various systems, my personal experience is with what appears the most common: 32bit CentOS 5 Server.
APC is maintained by core PHP developers, APC does not utilze a disk cache, unlike both eAccelerator and Xcache (although it is probably configurable). URL: http://pecl.php.net/package/APC
A drawback to consider is that due to known segfaults you could get an increase in error 500 or blank pages.
vBulletin 3.7 RC4 came with this in the announcement: "We recommend that vBulletin 3.7 is run on PHP 5.2.5 with APC (or a similar opcode cache) and MySQL 5.0.51 for best performance and stability."
Here are some instructions on how install APC on various systems and how to let vBulletin take use of it. My personal experience is with what appears the most common: 32bit CentOS 5 Server
Please note, due to installed control panels installation instructions might differ, this is for a dedicated box with no control panel.
Lets first install the pecl command so we can later download and install APC from the repositories.
Code:
yum install php-pear
Code:
yum install php-devel
Code:
yum install httpd-devel
Code:
pecl install apc
Code:
echo "extension=apc.so" > /etc/php.d/apc.ini
Code:
/etc/init.d/httpd start
You can find out if APC is now running by loading a phpinfo() page (vBulletin AdminCP > Maintenance > phpinfo) and search for APC block.
Now that it works, go into the includes/config.php file and enable the datastore class to use APC:
Find:
Code:
// $config['Datastore']['class'] = 'vB_Datastore_Filecache';
Code:
$config['Datastore']['class'] = 'vB_Datastore_APC';
Code:
// $config['Datastore']['prefix'] = '';
Code:
$config['Datastore']['prefix'] = 'vbfans_';
To test if it works your PEAR/APC should have come with a file called apc.php. You can now copy this to your vBulletin's directory and edit the file. Set a new user/pass for authentication and load the file in your browser. When you're done you can remove the apc.php file from this public dir.
And you're done.
I hope this helps some site owners to get a bit more performance out of their vBulletin powered community and give their visitors a more snappy experience. Note that 3.7 support APC but it works just as well without it. Hopefully in the future (say version 4 and up) vBulletin will make more and better use of op-cache like APC.
Apache v2.2.11 (cgi)
PHP: 5.2.8