如何从二进制文件安装 memcached 并包含在 c 文件中

How to install memcached from binaries and include in c file

本文关键字:包含 文件 memcached 二进制文件 安装      更新时间:2023-10-16

我正在尝试在ubuntu 16.04上安装memcached。我需要手动安装它,因为我想修改文件。我也不想在本地安装它,因为我的更改可能不是其他人想要从他们的内存缓存中得到的。

我尝试按照 github https://github.com/memcached/memcached/wiki/Install 中的说明进行操作(将前缀和 libevent 路径更改为在我的主目录中)。


Libevent安装:

./configure --prefix=/path/to/home/local_include

进行安装


这似乎有效,因为 memcached 配置没有抱怨。


内存缓存安装:

WGET https://memcached.org/latest

tar -zxf memcached-1.5.13.tar.gz

./configure --prefix=/path/to/home/local_include --with-libevent=/path/to/home/local_include

进行测试

进行安装


这样做我没有看到任何错误。这是我完成安装后的结果:

make  install-recursive
make[1]: Entering directory `/path/to/home/memcached-1.5.13'
Making install in doc
make[2]: Entering directory `/path/to/home/memcached-1.5.13/doc'
make  install-am
make[3]: Entering directory `/path/to/home/memcached-1.5.13/doc'
make[4]: Entering directory `/path/to/home/memcached-1.5.13/doc'
make[4]: Nothing to be done for `install-exec-am'.
/usr/bin/mkdir -p '/path/to/home/local_includes/share/man/man1'
/usr/bin/install -c -m 644 memcached.1 '/path/to/home/local_includes/share/man/man1'
make[4]: Leaving directory `/path/to/home/memcached-1.5.13/doc'
make[3]: Leaving directory `/path/to/home/memcached-1.5.13/doc'
make[2]: Leaving directory `/path/to/home/memcached-1.5.13/doc'
make[2]: Entering directory `/path/to/home/memcached-1.5.13'
make[3]: Entering directory `/path/to/home/memcached-1.5.13'
/usr/bin/mkdir -p '/path/to/home/local_includes/bin'
/usr/bin/install -c memcached '/path/to/home/local_includes/bin'
/usr/bin/mkdir -p '/path/to/home/local_includes/include/memcached'
/usr/bin/install -c -m 644 protocol_binary.h '/path/to/home/local_includes/include/memcached'
make[3]: Leaving directory `/path/to/home/memcached-1.5.13'
make[2]: Leaving directory `/path/to/home/memcached-1.5.13'
make[1]: Leaving directory `/path/to/home/memcached-1.5.13'

当我运行ps ax | grep memcached时,但是没有明显的程序正在安装的痕迹。


我还尝试重新安装并将制作安装说明更改为:

使安装 --前缀=前缀

使安装 --前缀=/路径/到/主页/local_lib

尽管

它们都没有被注册为可接受的参数(尽管 INSTALL 说明似乎表明它们会被注册)。

如果有人有任何想法,我将不胜感激。谢谢。

您构建了二进制文件,但尚未启动它。

尝试通过以下方式启动它:sudo service memcached restart

如果这不起作用,则运行以下命令:sudo /etc/init.d/memcached restart

相关文章: