我在从PECL 安装" memcached "PHP扩展时遇到问题,尽管我可以成功安装" memcache "扩展.(它们是单独的PHP扩展.)
例如,这些命令可以正常工作:
$ sudo pecl install memcache
$ sudo pecl install APC
$ sudo pecl install oauth
但是,尝试安装memcached会导致错误:
$ sudo pecl install memcached
...
ld:找不到-lmemcached的
库:collect2:ld返回1退出状态
make:***[memcached.la]错误1
错误:`make'失败
我在最近的Intel Mac上使用来自Mac Ports(macports.org)的pecl,memcached和libmemcached.libmemcached库可以在/ opt/local中找到:
/ opt/local/include/libmemcached
/opt/local/include/libmemcached/libmemcached_config.h
/opt/local/lib/libmemcached.2.0.0.dylib
/opt/local/lib/libmemcached.2.dylib
/opt/local /lib/libmemcached.a
/opt/local/lib/libmemcached.dylib
/opt/local/lib/libmemcached.la
知道我可能做错了吗?
Andrei Zmievski(memcached插件的开发者)按照以下说明友好地回复了我的电子邮件请求:
$ pecl download memcached $ tar zxvf memcached-1.0.0.tgz (or whatever version downloads) $ cd memcached-1.0.0 $ phpize $ ./configure --with-libmemcached-dir=/opt/local $ make $ sudo make install
这非常有效.