您的位置:首页 > 数据库 > Memcache

mac homebrew被坑

2018-08-09 10:11 337 查看
由于
Homebrew/php
自来水在2018年3月底弃用,并将所有PHP公式转移到
Homebrew/core
,旧的
brew tap homebrew/dupes、brew tap homebrew/versions、brew tap homebrew/homebrew-php
都会报以下错误(目前国内百度都找不到解决这个问题的方法):

Warning: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.

安装mac+nginx+mysql可看之前的文章,php安装和安装扩展,如memcached、redis等则不可在用
brew search php
查看扩展
brew install php70-memcached
这种方式安装扩展了。

安装php

brew install php56

安装php扩展(难点)
不推荐用 pecl 的方式安装 PHP 扩展。以 php-redis 扩展为例,下载源码包来进行安装:

wget https://pecl.php.net/get/redis-3.1.3.tgz # 下载源码包
tar -zxvf redis-3.1.3.tgz # 解压
cd redis-3.1.3
phpize # 生成编译配置
./configure # 编译配置检测
make # 编译
make install # 安装

注意:看清你安装的路径
安装memcach、memcached(
php5.几版本的需要安装[memcached-2.2.0.tgz](http://pecl.php.net/get/memcached-2.2.0.tgz) 才不会报错
)、mongo、mongodb可去pecl搜搜下载对应的包。下载下来直接解压安装包,建议把安装包放到php@5.6同一级目录中(如:
/usr/local/Cellar
)解压了文件就可以跳过之前安装的两步,直接
cd …进入生成编辑配置


安装遇到的错误

1.错误configure:error:请重新安装pkg-config分配
报错信息:Checking for pkg-config… /usr/bin/pkg-config
configure: error: Cannot find OpenSSL’s <evp.h>
解决办法:
wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz tar -zxvf pkg-config-0.28.tar.gz
cd pkg-config-0.28
./configure --with-internal-glib
make && make install
2.报错信息:fatal error: 'openssl/sha.h' file not found on installation
解决办法:
$ cd /usr/local/include
$ ln -s ../opt/openssl/include/openssl .
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息