Skip to content

Instantly share code, notes, and snippets.

@jdc-cunningham
Created April 16, 2018 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdc-cunningham/1fea5d34eedefda063b7ecf74c59980a to your computer and use it in GitHub Desktop.
Save jdc-cunningham/1fea5d34eedefda063b7ecf74c59980a to your computer and use it in GitHub Desktop.
example memcache test
<?php
// memcache test
$server = 'localhost';
if (!empty($_REQUEST['server'])) {
$server = $_REQUEST['server'];
}
$memcache = new Memcache;
$isMemcacheAvailable = @$memcache->connect($server);
// check memcache
if ($isMemcacheAvailable) {
echo "memcache available";
}
else {
echo "memcache not available";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment