title: error when installing pecl memcached
body: <p>I've been having real trouble installing the pecl memcached package. </p>
  
  <p>Have not had any joy with any yum or pear/pecl install commands I referred to this question <a href="https://stackoverflow.com/questions/22102326/install-pecl-memcached-error">Install PECL Memcached Error</a> and started trying to configure/make manually</p>
  
  <p>I'm using pecl to download the latest (memcached-2.2.0) then untar, phpize...</p>
  
  <p>If I configure with --disable-memcached-sasl the configure completes but make fails. With what looks like syntax errors</p>
  
  <pre><code>In file included from /root/memcached-2.2.0/php_memcached_private.h:28,
                   from /root/memcached-2.2.0/php_memcached.c:26:
  /root/memcached-2.2.0/php_libmemcached_compat.h:56: error: expected ‘=’, ‘,’, ‘;’, ‘asm’     or ‘__attribute__’ before ‘php_memcached_instance_st’
  /root/memcached-2.2.0/php_memcached.c:328: error: expected declaration specifiers or ‘...’ before ‘php_memcached_instance_st’
  /root/memcached-2.2.0/php_memcached.c:329: error: expected declaration specifiers or     ‘...’ before ‘php_memcached_instance_st’
  /root/memcached-2.2.0/php_memcached.c:330: error: expected declaration specifiers or ‘...’ before ‘php_memcached_instance_st’
  /root/memcached-2.2.0/php_memcached.c: In function ‘php_memc_get_impl’:
  /root/memcached-2.2.0/php_memcached.c:594: warning: passing argument 4 of     ‘memcached_mget_by_key’ from incompatible pointer type
  /usr/include/libmemcached/memcached_get.h:38: note: expected ‘char **’ but argument is of type ‘const char **’
  /root/memcached-2.2.0/php_memcached.c: In function ‘php_memc_getMulti_impl’:
  </code></pre>
  
  <p>There's more of that but hopefully thats a useful enough indicator</p>
  
  <p>If I use --with-libmemcached-dir=/usr/include/libmemcached i get</p>
  
  <pre><code>checking for libmemcached location... configure: error: Unable to find memcached.h under /usr/include/libmemcached
  </code></pre>
  
  <p>But that IS where memcached.h is</p>
  
  <p>If I use --with-libmemcached-dir=no configure gives</p>
  
  <pre><code>configure: error: no, libmemcached sasl support is not enabled. Run configure with --disable-memcached-sasl to disable this check
  </code></pre>
  
  <p>If i add the --disable-memcached-sasl option, it configure completes but make fails with the syntax errors again</p>
  
  <p>Feel like I'm stuck in a loop. </p>
  
  <p>This isn't the first time I've set up a server from scratch to use memcached (although first time in a while I guess) I don't remember having any issues before.</p>
  
  <p>Any ideas please anyone?</p>
  
  <p><strong>This looked like a good lead</strong></p>
  
  <p><a href="http://blusmurf.net/2012/08/27/pecl-memcache-build-error/" rel="noreferrer">http://blusmurf.net/2012/08/27/pecl-memcache-build-error/</a></p>
  
  <p>But not joy still</p>
  
  <p><strong>I've also been investigating this issue from php-memcached's github page</strong></p>
  
  <p><a href="https://github.com/php-memcached-dev/php-memcached/issues/69" rel="noreferrer">https://github.com/php-memcached-dev/php-memcached/issues/69</a></p>
  
  <p>I've tried with 2.1 and 2.2 now, hacking the files to try and get make to build. Still no luck...</p>