title: Memcache connects but doesn't respond to any command
body: <p><strong>Setup:</strong>
  Apache; PHP 5.2.9; libevent (for memcached it's required) version 1.3; memcached server version 1.2.2 (tried 1.4.5, 1.4.0, now downgraded to 1.2.2, no difference); memcached php pecl module version 2.2.6.</p>
  <p><strong>Problem:</strong></p>
  <p>Similar to unresolved problems <a href="https://stackoverflow.com/questions/2107398/cannot-store-values-into-memcache">cannot store values into memcache</a> and <a href="https://stackoverflow.com/questions/2872928/super-strange-php-error">Super strange PHP error</a></p>
  <p>None of those threads had resolved issue and none of the authors of questions followed recommendations given. I followed them all, and it still doesn't work.</p>
  <p><code>Memcache</code> code doesn't show any error if I am connecting via PHP, but as soon as I'm trying to execute any command (such as <code>getVersion</code>), I get the response:</p>
  <p><code>Notice: memcache_get_version() [function.memcache-get-version]: Server 127.0.0.1 (tcp 11211) failed with: Failed reading line from stream (0) in /var/www/html/memcache.php on line 11</code></p>
  <p><strong>Solutions tried:</strong></p>
  <p>Connecting to memcache via command line is not working. After I type any command connection is closing.</p>
  <pre><code>[/usr/local/src]$ telnet 127.0.0.1 11211
  Trying 127.0.0.1...
  Connected to 127.0.0.1.
  Escape character is '^]'.
  stats
  Connection closed by foreign host.
  </code></pre>
  <p>I tried <code>$ memcached -S</code> to make sure memcached was compiled with SASL support disabled.
  Response: &quot;This server is not built with SASL support.&quot;</p>
  <p>Also, one of the comments was</p>
  <blockquote>
  <p>You may be running memcached without ASCII protocol support, such as if you ran:</p>
  <pre><code> $ memcached -B binary
  </code></pre>
  <p>If this is the case, remove the <code>-B</code> argument entirely, and PHP and telnet should work.</p>
  </blockquote>
  <p>The memcache start line is:</p>
  <pre><code>memcached -d -m 1024 -u root -l 127.0.0.1 -p 11211
  </code></pre>
  <p>No B argument in it.</p>
  <p>Any ideas?</p>