We’ve been benchmarking Amazon EC2 server instances for some highly complicated PHP applications over the past week. During this time, we’ve discovered that XCache is perhaps the best opcode caching product for our purposes.
If anyone would like a walkthrough for installing XCache on an Amazon EC2 instance, simply leave a comment below and we will prepare a full tutorial for you!
There are a lot of other steps involved, too, such as launching your instance, installing Apache, PHP, MySQL, and some other tools and tricks – if you’re stuck with any of those elements, let me know, too, and I will endeavour to point you in the right direction!
This is the level of service that our Enterprise and Managed Maintenance clients receive as standard: we fit the hosting, which you can then pay for and manage internally, or we’ll provide fully outsourced CTO services for your business – allowing you to get on with, well, running your business.
Contact Us if you’d like to talk about us managing your website development and hosting in this way.
Steps to Install XCache on Amazon EC-2
The following is what I used to setup XCache on a fairly empty EC2 instance. You may need to toggle some settings, like the version:
wget http://xcache.lighttpd.net/pub/Releases/2.0.0/xcache-2.0.0.tar.gz
tar -zxf xcache-2.0.0.tar.gz
yum install php-devel
yum install gcc
./configure --enable-xcache
yum install make
make
cat xcache.ini >> /etc/php.ini
nano /etc/php.ini
service httpd restart
make test
nano /etc/php.ini
nano /etc/php.ini
yum install mlocate.x86_64
updatedb
locate xcache.so
nano /etc/php.ini
service httpd restart
php -i |grep xcache
Please leave a comment if you get stuck along the way.
Note this is an updated post, so I’ve updated the date.
Hi,
I’m struggling with xcache install on Ubuntu 12.04 64 bits EC2.
PHP5.3
Apache2
Any tutorial appreciated 🙂
Hi Leo,
Oh, Ubuntu, I believe, will use some different commands – we use “Amazon”‘s Linux (64 bit), which is I believe a Centos fork. Its basically Centos with some Amazon engineer updates and additions from what I can tell.
I will dig out the notes I took at the time!
Here is what I have in my code pad from this:
wget http://xcache.lighttpd.net/pub/Releases/2.0.0/xcache-2.0.0.tar.gz
tar -zxf xcache-2.0.0.tar.gz
yum install php-devel
yum install gcc
./configure --enable-xcache
yum install make
make
cat xcache.ini >> /etc/php.ini
nano /etc/php.ini
service httpd restart
make test
nano /etc/php.ini
nano /etc/php.ini
yum install mlocate.x86_64
updatedb
locate xcache.so
nano /etc/php.ini
service httpd restart
php -i |grep xcache
Obviously, grab a later release if there is one! Also, you may already have completed some of the steps.