title: Memcache connect throws error in cron job
body: <p>When i try to connect to memcached server from a php page, it works without any problem.
  Using this code</p>
  
  <pre><code>$memcache = new Memcache;
  $memcache-&gt;connect('localhost', 11211) or die ("Could not connect");
  </code></pre>
  
  <p>But when it tries to connect to server from a php script which is fired by cron job it throws this error</p>
  
  <pre><code>Warning: Memcache::connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/...../cron/acts_cron.php on line 3
  
  Warning: Memcache::connect(): Can't connect to localhost:11211, php_network_getaddresses: getaddrinfo failed: Name or service not known (0) in /home/...../cron/acts_cron.php on line 3
  Could not connect
  </code></pre>
  
  <p>What can cause this problem ?</p>