Mac安装memcached

版权声明:== https://github.com/fyonecon == https://blog.csdn.net/weixin_41827162/article/details/82049520

经过实践,建议不要在本机上安装后端开发环境,毕竟与真实服务器环境相比,本机(如Mac、Win)原始开发环境差太多。

所以建议,在Vmware 虚拟机中安装Centos7,模拟真实开发环境。这个样环境真实,而且环境好移植。

--------------------

安装PHP主环境:

方法一:宝塔面板 https://www.bt.cn/

方法二:一键lnmp https://lnmp.org/install.html ,这个需要再次安装自定义扩展,如vsftp、memcached。

安装过程可以参考https://blog.csdn.net/weixin_41827162/article/details/82914526

--------------------

--------------------

1. 先给Mac安装brew命令行,https://brew.sh/

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2. 安装libevent

brew install libevent

3. 检查libevent

brew info libevent

4. 安装memcacehd

brew install memcached 

5. 检查memcached

brew info memcached

注意,如何启动memcachaed:

To have launchd start memcached now and restart at login:
  brew services start memcached
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/memcached/bin/memcached

检查是否启动成功

ps -ef|grep memcached

检查各项memcached参数

memcached -h

6. 安装telnet

brew install telnet

7. 测试lianjie

telnet localhost 11211

文章参考:https://blog.csdn.net/weixin_37696997/article/details/78574683

https://brew.sh/

整个躺枪过程如下:

Last login: Sat Aug 25 10:05:04 on ttys000
SeenochengdeMacBook-Pro:~ see$ brew info libwent
Error: No available formula with the name "libwent"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
SeenochengdeMacBook-Pro:~ see$
SeenochengdeMacBook-Pro:~ see$ brew info libevent
libevent: stable 2.1.8 (bottled)
Asynchronous event library
https://libevent.org/
Conflicts with:
  pincaster (because both install `event_rpcgen.py` binaries)
/usr/local/Cellar/libevent/2.1.8 (847 files, 2.2MB) *
  Poured from bottle on 2018-08-25 at 10:37:12
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/libevent.rb
==> Dependencies
Build: autoconf ✘, automake ✘, doxygen ✘, libtool ✘, pkg-config ✘
Required: openssl ✔
SeenochengdeMacBook-Pro:~ see$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /Library/Caches/Homebrew
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown see /Library/Caches/Homebrew
==> Downloading and installing Homebrew...
HEAD is now at cc63c1224 Merge pull request #4570 from maxim-belkin/fix-linux-make-shim
==> Migrating /Library/Caches/Homebrew to /Users/see/Library/Caches/Homebrew...
==> Deleting /Library/Caches/Homebrew...
Already up-to-date.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics.html

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations
==> Next steps:
- Run `brew help` to get started
- Further documentation:
    https://docs.brew.sh
SeenochengdeMacBook-Pro:~ see$ brew info libevent
libevent: stable 2.1.8 (bottled)
Asynchronous event library
https://libevent.org/
Conflicts with:
  pincaster (because both install `event_rpcgen.py` binaries)
/usr/local/Cellar/libevent/2.1.8 (847 files, 2.2MB) *
  Poured from bottle on 2018-08-25 at 10:37:12
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/libevent.rb
==> Dependencies
Build: autoconf ✘, automake ✘, doxygen ✘, libtool ✘, pkg-config ✘
Required: openssl ✔
SeenochengdeMacBook-Pro:~ see$ brew info memcached


memcached: stable 1.5.10 (bottled)
High performance, distributed memory object caching system
https://memcached.org/
Conflicts with:
  mysql-cluster (because both install `bin/memcached`)
/usr/local/Cellar/memcached/1.5.10 (11 files, 199.3KB) *
  Poured from bottle on 2018-08-25 at 10:37:33
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/memcached.rb
==> Dependencies
Required: libevent ✔
==> Options
--with-sasl
	Enable SASL support -- disables ASCII protocol!
--with-sasl-pwdb
	Enable SASL with memcached's own plain text password db support -- disables ASCII protocol!
==> Caveats
To have launchd start memcached now and restart at login:
  brew services start memcached
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/memcached/bin/memcached
SeenochengdeMacBook-Pro:~ see$
SeenochengdeMacBook-Pro:~ see$
SeenochengdeMacBook-Pro:~ see$ brew install libevent
Warning: libevent 2.1.8 is already installed and up-to-date
To reinstall 2.1.8, run `brew reinstall libevent`
SeenochengdeMacBook-Pro:~ see$ brew install memcached
Warning: memcached 1.5.10 is already installed and up-to-date
To reinstall 1.5.10, run `brew reinstall memcached`
SeenochengdeMacBook-Pro:~ see$ brew reinstall memcached
==> Reinstalling memcached
==> Downloading https://homebrew.bintray.com/bottles/memcached-1.5.10.high_sierra.bottle.tar.gz
Already downloaded: /Users/see/Library/Caches/Homebrew/memcached--1.5.10.high_sierra.bottle.tar.gz
==> Pouring memcached--1.5.10.high_sierra.bottle.tar.gz
==> Caveats
To have launchd start memcached now and restart at login:
  brew services start memcached
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/memcached/bin/memcached
==> Summary

猜你喜欢

转载自blog.csdn.net/weixin_41827162/article/details/82049520