From DreamHost
Jump to: navigation, search
The instructions provided in this article or section are considered advanced.

You are expected to be knowledgeable in the UNIX shell.
Support for these instructions is not available from DreamHost tech support.
Server changes performed by DreamHost may break your modifications. You, as the user, are responsible for troubleshooting and resolving issues with your customizations.

Dh-kb-important-icon.fw.png Important: This article contains information/examples about root/sudo/admin users.

On December 9, 2015, DreamHost disabled admin users on VPS machines (private servers). For details of why this was done, please review the following article:

If you still require sudo/admin access, you must upgrade to a Dedicated server.


Memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. Many web applications (MediaWiki, Drupal, and so on) offer support for memcached.

Danga Interactive developed memcached to enhance the speed of, a site which was already doing 20 million+ dynamic page views per day for 1 million users with numerous webservers and database servers. Memcached dropped the database load to almost nothing, yielding faster page load times for users, better resource utilization, and faster access to the databases on a memcache miss.

memcached is only available on VPS and Dedicated hosting plans.

Installing the memcached server daemon

  1. Log into your server via SSH. Make sure you log into the server using an admin user on the VPS.
  2. Run the following command to change to the root user:
    sudo su
  3. Run the following to install the memcached daemon (server-based) package:
    apt-get install memcached
  4. After installing the memcached daemon, download a client package to access the server and extend PHP to connect to your memcached daemon.

Using the PECL memcached client

  1. Review the memcached installation documentation at
  2. Obtain the prerequisite libmemcache at
    tar -zxvf  libmemcached-1.0.8.tar.gz
    cd  libmemcached-1.0.8
    make install

Using PECL’s memcache client

To use the PECL memcache client:

  1. Download the source code and compile it:
    tar -zxvf memcache-3.0.5.tgz
    cd memcache-3.0.5
  2. Compile for PHP 5.4:
    ./configure --with-php-config=/usr/local/php54/bin/php-config
    make install
    • The ‘make install’ command ends with the following response:
    Installing shared extensions:     /usr/local/php54/lib/php/extensions/no-debug-non-zts-20100525/
  3. After the shared object is compiled, add it to your PHP configuration.
    Dh-kb-note-icon.fw.png Note: For further information on adding a phprc file under the user your domain runs on, visit the following page:

  4. Add the following line to that phprc file:
    extension = “/usr/local/php54/lib/php/extensions/no-debug-non-zts-20100525/”
  5. Kill off all running PHP processes. For further information, visit the following page:
  6. Check your PHP configuration in a phpinfo.php file to confirm the extension is loading. For further information, visit the following page:
    01 memcached.png