我可以使用PECL安装memcached PHP扩展吗? [英] Can I install the memcached PHP extension with PECL?

查看:219
本文介绍了我可以使用PECL安装memcached PHP扩展吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法从PECL安装" memcached "PHP扩展,但是我可以成功安装了" memcache 扩展名. (它们是单独的PHP扩展.)

I'm having trouble installing the "memcached" PHP extension from PECL, though I can successfully installed the "memcache" extension. (They are separate PHP extensions.)

例如,这些命令可以正常工作:

For example, these commands work okay:

$ sudo pecl安装内存缓存
$ sudo pecl安装APC
$ sudo pecl安装oauth

$ sudo pecl install memcache
$ sudo pecl install APC
$ sudo pecl install oauth

但是,尝试安装memcached会导致错误:

However, attempting to install memcached causes errors:

$ sudo pecl install memcached
...
ld:找不到-lmemcached
的库 collect2:ld返回1退出状态
制作:*** [memcached.la]错误1
错误:"make"失败

$ sudo pecl install memcached
...
ld: library not found for -lmemcached
collect2: ld returned 1 exit status
make: *** [memcached.la] Error 1
ERROR: `make' failed

我正在最近的Intel Mac上的Mac Ports(macports.org)中使用pecl,memcached和libmemcached.可以在/opt/local中找到libmemcached库:

I'm using pecl, memcached, and libmemcached from Mac Ports (macports.org) on a recent Intel Mac. The libmemcached libraries can be found in /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

/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

知道我可能在做什么错吗?

Any idea what I may be doing wrong?

推荐答案

Andrei Zmievski(memcached插件的开发人员)以以下说明对我的电子邮件请求进行了答复:

Andrei Zmievski (developer of the memcached plugin) kindly answered my email request with the following instructions:

$ 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

这很好用.

这篇关于我可以使用PECL安装memcached PHP扩展吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆