How to Enable and Use Memcached with PHP on TrexHost

TrexHost – Best Web Hosting: Fast, Reliable & Affordable Solutions - Visit: https://trexhost.com

The Memcached system is used by some of the most traffic heavy sites such as YouTube, Facebook, Twitter.

It is also supported by some popular CMSs such as Drupal, Joomla, and WordPress.

To use Memcached with PHP on your TrexHost hosting account, please enable the Memcached extension from the hosting control panel at Advanced → PHP Settings → Edit php.ini, set Memcached to On.

To have Memcached enabled, your hosting plan needs to have Memcached instances available. Each instance comes with 16 MB of dedicated memory.

To create a Memcached instance:

  1. Navigate to Advanced → Memcached in your hosting control panel.
  2. Click the CREATE INSTANCE button.
  3. Set the status to Active.
  4. Select the desired memory allocation (each instance provides 16 MB).
  5. Click the Add button to complete the setup.

If you need additional instances, you can purchase them as an upgrade from the Add/Upgrade Service(s) section in your hosting control panel.

Important: many applications require host and port to link them with Memcached. On our system the Memcached works on a Socket instead of Port.

In this case you need to use

Memcached hostname(IP): unix:///home/sys/memcached.sock
Memcached Port: 0

Example: $memcached->addServer(‘unix:///home/sys/memcached.sock’, 0);

1 thought on “How to Enable and Use Memcached with PHP on TrexHost”

  1. Pingback: Why my website is loading slow? | TrexHost

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top