In some cases if you are running WordPress OR some other database extensive application on micro instances, you will experience slow page loading on various occasions.

There is a nice solution to that, install PHP APC to cache most the PHP code for fast loading.

I assume that you are already on the server console through SSH:

sudo su

1st let’s install few needed dependencies including php pear:

yum install php-pear httpd-devel php-devel

Now time to install APC by pecl command:

pecl install apc

Add a line to apc.ini to load the module:

echo "extension=apc.so" > /etc/php.d/apc.ini

Restart the httpd server:

service httpd restart

You will notice quite a difference now. The execution time per page will now reduce dramatically. I have tested it on a micro instance for a WordPress site, and i can confirm that the site loads fast now.

Series:
Part-1: Setup web server on Amazon AMI or CentOS
Part-2: Backup MySQL data into CSV
Part-3: Backup MySQL data into CSV with PHP
Part-4: Backup and Restore MySQL databases
Part-5: Speed up your website loading time by using PHP APC