Php – memcached php module not compiling on EC2

amazon ec2memcachedPHP

I'm trying to do this on EC2, micro instance using amazon linux

I installed and started the memcached service without problems. But when trying to make the php part using pecl it told me pecl wasnt installed. So I installed pear, then pecl, when trying to run pecl install memcache I got an error asking for zlib (which btw, is installed), so instead I did this:

wget http://pecl.php.net/get/memcache-2.2.5.tgz
tar xvf memcache-2.2.5.tgz
cd memcache-2.2.5
phpize
./configure --with-zlib-dir=/usr/share/syslinux/com32/

But when I do the "make", I get a long list of errors, all of them in "zend" files, mostly missing types (ie. uint, hash_func_t, etc.).

My guess is that something else needs to be installed (ie. an include file with all the types that is asking for) , so I dont have to define all the missing types myself

In file included from /usr/include/php/Zend/zend.h:237,
                 from /usr/include/php/main/php.h:35,
                 from /usr/local/src/memcache-2.2.5/memcache.c:26:
/usr/include/php/Zend/zend_alloc.h:49: error: expected specifier-qualifier-list before 'uint'
In file included from /usr/include/php/Zend/zend.h:270,
                 from /usr/include/php/main/php.h:35,
                 from /usr/local/src/memcache-2.2.5/memcache.c:26:
/usr/include/php/Zend/zend_hash.h:45: error: expected declaration specifiers or '...' before '*' token
/usr/include/php/Zend/zend_hash.h:45: error: expected declaration specifiers or '...' before 'uint'
/usr/include/php/Zend/zend_hash.h:45: error: 'ulong' declared as function returning a function
/usr/include/php/Zend/zend_hash.h:55: error: field 'h' declared as a function
/usr/include/php/Zend/zend_hash.h:56: error: expected specifier-qualifier-list before 'uint'
/usr/include/php/Zend/zend_hash.h:67: error: expected specifier-qualifier-list before 'uint'
/usr/include/php/Zend/zend_hash.h:87: error: expected specifier-qualifier-list before 'uint'
/usr/include/php/Zend/zend_hash.h:99: error: expected declaration specifiers or '...' before 'uint'
/usr/include/php/Zend/zend_hash.h:99: error: expected declaration specifiers or '...' before 'hash_func_t'
In file included from /usr/include/php/Zend/zend.h:270,
                 from /usr/include/php/main/php.h:35,
                 from /usr/local/src/memcache-2.2.5/memcache.c:26:
/usr/include/php/Zend/zend_hash.h:100: error: expected declaration specifiers or '...' before 'uint'
/usr/include/php/Zend/zend_hash.h:100: error: expected declaration specifiers or '...' before 'hash_func_t'

etc… (list of errors is long…)

Best Answer

What about simply installing php-pecl-memcache instead of compiling one ?