我正在尝试使用 amazon linux 在 EC2 微实例上执行此操作
我安装并启动了 memcached 服务,没有任何问题。但是当我尝试使用 pecl 制作 php 部分时,它告诉我 pecl 未安装。因此,我安装了 pear,然后安装了 pecl,当尝试运行 pecl install memcache 时,我收到一条错误,要求安装 zlib(顺便说一下,已安装),因此我改为执行以下操作:
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/
但是当我执行“make”时,我收到一长串错误,所有错误都在“zend”文件中,大多数缺少类型(即 uint、hash_func_t 等)。
我的猜测是需要安装其他东西(即包含所有要求类型的包含文件),所以我不必自己定义所有缺失的类型
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'
等等...(错误列表很长...)
答案1
那么,简单地安装php-pecl-memcache
而不是编译怎么样?