How to Configure PHPFox with Memcached
For those not aware, PHPFox is an application that will help you build your own social network. You can have hundreds or thousands of people on your community, interacting at the same time.
However, when your social networking website grows big, this may slow it down. The resource consumption of your website will grow, the number of requests executing on the server will multiply and this will slow your website down. Of course, this is something that you need to think about, as if your website becomes slow, it will not attract new members and the existing ones may decide to go away.
One of the ways to speed up your PHPFox website is to enable Memcached on it. This greatly speeds up the performance of your website, serving requests to your website directly from the Memcached cache. The service is memory consuming, but we offer it to all our clients on E-Commerce Geek plans. We suggest reviewing our PHPFox Hosting plans, as well as the compare page, so you can get much more detailed information on our plans and what we can do for your website.
What is Memcached?
Memcached is an object caching system, which is used to speed up the dynamic content of web applications. It is an in-memory caching and it stores the result from database calls, API calls or the rendering of pages in the memory on your server for quicker loading the next time there is a request to your website.
The use of Memcached can significantly improve the performance of your website, but it is also a memory consuming cache engine. You need to consider that before you attempt using it on your PHPFox installation.
Note that we offer few hosting plans that are suitable for Memcached and you will be able to use it for your project. If you are interested in a shared hosting service, you can consider our E-Commerce plan, which will allow you to use Memcached. If you are a more advanced user and you need a Cloud VPS or Dedicated Server plan, we can offer that as well. The service is optimized for best PHPFox performance, but if you would like to use Memcached, you can contact our technical support team so they can configure it on the server for you.
How to enable Memcached in PHPFox
To enable Memcached on your website, you will simply have to edit the PHPFox configuration file. Our guide will provide the steps on how to locate it and then access it for editing.
There are two things that you need to change in the configuration file, so you can start using the Memcached service for your project. When you access the file, locate the following line of code:
$_CONF['core.cache_storage'] = 'file';
and replace it with:
$_CONF['core.cache_storage'] = 'memcache';
When you change that, Memcached will be set as a caching engine for your website, but you need to tell your PHPFox installation how to connect to it. Look for the following line of code:
$_CONF['core.memcache_hosts'] = array();
and change it with:
$_CONF['core.memcache_hosts'] = array(
'host' => '127.0.0.1',
'port' => '11211'
The important thing to consider in the code above is the host and port values. The host value is telling your PHPFox installation how to connect to the Memcached service. If it is installed on the same server, it will be the same value as the one we used – 127.0.0.1. However, if you have a separate Memcached server, you will have to tell your application how to connect to it. The port value is the actual port, on which Memcached is listening. The default port number is 11211, but this may differ, depending on the way you have set the caching system on your server.
As always, if you need assistance with the configuration in question, our technical support team will gladly configure your website. You can simply open a ticket via your Client Area. If you are not an existing client, you can consider our PHPFox Hosting plans for best performance and security for your website!
The latest tips and news from the industry straight to your inbox!
Join 30,000+ subscribers for exclusive access to our monthly newsletter with insider cloud, hosting and WordPress tips!