簡體   English   中英

如何在Mac OS X Yosemite 10.10上安裝libmemcached以便在Mamp 3上安裝memcached.so PHP擴展?

[英]How can I install libmemcached for Mac OS X Yosemite 10.10 in order to install the memcached.so PHP extension on Mamp 3?

我需要在運行Mac OS X Yosemite的MacBook Pro上安裝libmemcached。

我已經安裝了memcached守護進程,但是為了使PHP memcached.so PECL擴展能夠工作,我需要安裝libmemcached。

我從https://launchpad.net/libmemcached/+download下載了tar.gz,查看了文件README.FIRST:

Hi!

If you are getting this code from http://launchpad.net/libmemcached then
continue reading. Otherwise these directions are not for you (well maybe...).

To obtain code from http://bazaar.launchpad.net/libmemcached you will need to
issue the following command:

bzr branch lp:libmemcached

Once the tree is cloned you will need to build the "configure" script. You
can do this by running the script:

./bootstrap.sh autoreconf

It will set up all of the files you need to build libmemcached. At that
point it is just the typical "./configure; make; make test; make install"

For a tarball release do a "make dist" and for an RPM type "make rpm".

For patches, we prefer you push a branch to launchpad and then submit that 
branch to be merged. For more information, see:

https://help.launchpad.net/Code/UploadingABranch
https://help.launchpad.net/Code/Review

Thanks and keep hacking!

Cheers,
  -Brian
  Seattle, WA.

所以我安裝了Bazaar,然后輸入以下命令:

bzr branch lp:libmemcached

但我得到的是:

    bzr: warning: unsupported locale setting
  bzr could not set the application locale.
  Although this should be no problem for bzr itself, it might
  cause problems with some plugins. To investigate the issue,
  look at the output of the locale(1p) tool.
Not checking SSL certificate for xmlrpc.launchpad.net.
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data.  See "bzr help launchpad-login".
bzr: ERROR: Target directory "libmemcached" already exists.  

如果我嘗試運行./configure然后make ,我會收到很多警告:

./libmemcached/server.hpp:82:62: warning: implicit conversion loses integer precision: 'uint64_t'
  (aka 'unsigned long long') to 'uint32_t' (aka 'unsigned int') [-Wshorten-64-to-32]

libmemcached/csl/scanner.cc:2070:2: warning: 'register' storage class specifier is deprecated
      [-Wdeprecated-register]

libmemcached/byteorder.cc:75:10: error: use of undeclared identifier 'htonll'

還有2個錯誤:

2 errors generated.
make[1]: *** [libmemcached/libmemcached_libmemcached_la-byteorder.lo] Error 1
make: *** [all] Error 2

所以實際上我無法安裝libmemcached。 有什么選擇我可以嘗試,我該如何解決這個問題? 為什么所有這些錯誤?

感謝您的關注!

希望得到一些幫助。

我已經設法通過更改配置腳本和其中一個源文件來獲取libmemcached以在OSX 10.10.3上編譯和安裝。

configure我更改了行:

if ac_fn_cxx_try_compile "$LINENO"; then :
    ac_cv_have_htonll=yes
else
    ac_cv_have_htonll=no
fi

至:

ac_cv_have_htonll=no

然后在clients/memflush.cc我更改了2個實例:

if (opt_servers == false)

至:

if (opt_servers == NULL)

之后通常的configuremakesudo make install工作正常(盡管有很多警告)。 然后該庫似乎工作正常,在我的情況下使用pylibmc。

我知道很久以前就問過這個問題,但問題出在我看來的其他地方,即缺少的問題。

這就是我在(macOS High Sierra 10.13)上修復問題的方法:

在bytesorder.cc中,我在byteorder.h之后添加了這三行:

#if defined HAVE_HTONLL && defined HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM