我可以使用 PECL 安装 memcached PHP 扩展吗?
我在从 PECL 安装“memcached” PHP 扩展时遇到问题,尽管我可以成功安装“memcache”扩展。 (它们是单独的 PHP 扩展。)
例如,这些命令可以正常工作:
$ sudo pecl 安装内存缓存
$ sudo pecl 安装 APC
$ sudo pecl 安装 oauth
但是,尝试安装 memcached 会导致错误:
$ sudo pecl 安装 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
知道我可能做错了什么吗?
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 install memcache
$ sudo pecl install APC
$ sudo pecl install oauth
However, attempting to install memcached causes errors:
$ sudo pecl install memcached
...
ld: library not found for -lmemcached
collect2: ld returned 1 exit status
make: *** [memcached.la] Error 1
ERROR: `make' failed
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
Any idea what I may be doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这里的情况也一样。 我必须执行上述操作,但具有明确的路径名(我在/ opt / local之外运行我的php等)
通常这种东西在带有 macports 的 os x 上非常简单,但是还没有 php5-memcached 包(只有一个)对于较旧的 memcache(无“d”)包)。 哦,我还必须安装旧版本的 libmemcached,因为最新版本无法在 os x 10.5.8 上编译。 哦!
same situation here. i had to do the above, but with explicit path names (i run my php etc. out of /opt/local)
normally this kind of stuff is pretty simple on os x with macports, but there is no php5-memcached package yet (only one for the older, memcache (no "d") package). oh, an i also had to install an older version of libmemcached, since the latest version didn't compile on os x 10.5.8 for me. oy!
正如您所看到的,新的 memcached 扩展使用 libmemcached 来完成繁重的工作。 如果是 Linux,我会说你可能没有在 ld.so.conf 中列出 /opt/local/lib/ (并运行“ldconfig”)。
不过 MaxOSX 不使用它。 然而,它显然可以从“端口”安装。 http://lsimons.wordpress.com/2008/05 /01/serious-php-part-1/
As you've seen, the new memcached extension, uses libmemcached to do the heavy lifting. If it were Linux, I'd say that it was possible that you don't have /opt/local/lib/ listed in ld.so.conf (and run 'ldconfig').
MaxOSX doesn't use that though. It is, however installable from 'ports' apparently. http://lsimons.wordpress.com/2008/05/01/serious-php-part-1/
好吧,经过多次尝试,只有这个解决方案适合我。
瞧!
Well, after many tries only this solution works for me.
VOILA !!
Andrei Zmievski(memcached 插件的开发者)用以下说明回复了我的电子邮件请求:
这非常有效。
Andrei Zmievski (developer of the memcached plugin) kindly answered my email request with the following instructions:
This worked perfectly.