关于 Mac 上用 Homebrew 更新软件后无效的问题求助

半年以前可以用的 gtk+3 发现现在不能用了,用 homebrew 把所有软件更新了一道之后再编译就显示如下问题:

 $ gcc -o test1 test.c `pkg-config --libs --cflags gtk+-3.0`
Package 'gdk-3.0' requires 'cairo >= 1.14.0' but version of cairo is 1.12.16
test.c:1:10: fatal error: 'gtk/gtk.h' file not found
#include <gtk/gtk.h>
         ^
1 error generated.

但是我检查我的 cairo 版本发现已经是最新的 1.14.6

 e$ brew list cairo
/usr/local/Cellar/cairo/1.14.6/bin/cairo-sphinx
/usr/local/Cellar/cairo/1.14.6/bin/cairo-trace
/usr/local/Cellar/cairo/1.14.6/include/cairo/ (14 files)
/usr/local/Cellar/cairo/1.14.6/lib/libcairo-gobject.2.dylib
/usr/local/Cellar/cairo/1.14.6/lib/libcairo-script-interpreter.2.dylib
/usr/local/Cellar/cairo/1.14.6/lib/libcairo.2.dylib
/usr/local/Cellar/cairo/1.14.6/lib/cairo/ (9 files)
/usr/local/Cellar/cairo/1.14.6/lib/pkgconfig/ (13 files)
/usr/local/Cellar/cairo/1.14.6/lib/ (6 other files)
/usr/local/Cellar/cairo/1.14.6/share/gtk-doc/ (65 files)

表示要疯了 XD

2个回答

0 Homebrew是啥?

“Homebrew installs the stuff you need that Apple didn’t.——Homebrew 使 OS X 更完整”。

Homebrew的官网[1](多语言版本)简单明了地介绍了如何安装和使用这个工具,并提供了自己的Wiki。

1 安装Homebrew

brew的安装很简单,使用一条ruby命令即可,Mac系统上已经默认安装了ruby。

gerryyang@mba:bin$ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]

关于安装brew的详细说明可以参考其github上的wiki说明[2]:

"
Installation

The suggested and easiest way to install Homebrew is on the homepage. We don’t duplicate it here because it is asecurity risk to list it on a user-editable wiki.

The standard script installs Homebrew to /usr/local so that you don’t need sudo when youbrew install. It is acareful script, it can be run even if you have stuff installed to/usr/local already. It tells you exactly what it will do before itdoes it too. And you have to confirm everything it will do before itstarts.

There are other ways to install Homebrew which provide you with moreflexibility. They are listed below the requirements.

"

gerryyang@mba:~$ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

It appears Homebrew is already installed. If your intent is to reinstall you

should do the following before running this installer again:

rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup  

由于我的系统上已经安装过brew,因此再次执行安装命令会提示我brew已经存在。

2 Homebrew的用法

查看brew的具体用法:

gerryyang@mba:~$brew

Example usage:

brew [info | home | options ] [FORMULA...]

brew install FORMULA...

brew uninstall FORMULA...

brew search [foo]

brew list [FORMULA...]

brew update

brew upgrade [FORMULA...]

brew pin/unpin [FORMULA...]

Troubleshooting:

brew doctor

brew install -vd FORMULA

brew [--env | --config]

Brewing:

brew create [URL [--no-fetch]]

brew edit [FORMULA...]

open https://github.com/Homebrew/homebrew/wiki/Formula-Cookbook

Further help:

man brew

brew home

gerryyang@mba:~$

3 Homebrew的有趣问题

下面关于Homebrew的一些常见问题[3]:

(1) 在OS X中找不到想要的软件,可以使用brew安装;

gerryyang@mba:~$brew install wget

==> Downloading http://ftpmirror.gnu.org/wget/wget-1.14.tar.gz

######################################################################## 100.0%

==> ./configure --prefix=/usr/local/Cellar/wget/1.14 --sysconfdir=/usr/local/etc

==> make install

Warning: Could not link wget. Unlinking...

Error: The brew link step did not complete successfully

The formula built, but is not symlinked into /usr/local

You can try again using `brew link wget'

Possible conflicting files are:

/usr/local/bin/wget

/usr/local/share/man/man1/wget.1

==> Summary

/usr/local/Cellar/wget/1.14: 8 files, 688K, built in 2.3 minutes

由于之前使用源码方式安装过wget,因此再用brew安装时会提示冲突的错误,因为/usr/locat/bin/wget已经存在。实际上,Homebrew 将软件包分装到单独的目录(/usr/local/Cellar),然后 symlink 到 /usr/local 中。

(2) 如何更新本地已安装的package呢?

第一步:先更新brew:

brew update

gerryyang@mba:bin$brew update

Already up-to-date.

第二步:更新所有package:
brew upgarde

gerryyang@mba:bin$brew upgrade

==> Upgrading 1 outdated package, with result:

wget 1.15

==> Upgrading wget

==> Installing wget dependency: openssl

==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/openssl-1.0

######################################################################## 100.0%

==> Pouring openssl-1.0.1f.mavericks.bottle.tar.gz

==> Caveats

This formula is keg-only, so it was not symlinked into /usr/local.

Mac OS X already provides this software and installing another version in

parallel can cause all kinds of trouble.

The OpenSSL provided by OS X is too old for some software.

Generally there are no consequences of this for you. If you build your

own software and it requires this formula, you'll need to add to your

build variables:

LDFLAGS:  -L/usr/local/opt/openssl/lib  
CPPFLAGS: -I/usr/local/opt/openssl/include  

==> security find-certificate -a -p /Library/Keychains/System.keychain > '/usr/l

==> security find-certificate -a -p /System/Library/Keychains/SystemRootCertific

==> mv -f /usr/local/etc/openssl/osx_cert.pem.tmp /usr/local/etc/openssl/osx_cer

==> Summary

/usr/local/Cellar/openssl/1.0.1f: 429 files, 15M

==> Installing wget

==> Downloading http://ftpmirror.gnu.org/wget/wget-1.15.tar.gz

######################################################################## 100.0%

==> ./configure --prefix=/usr/local/Cellar/wget/1.15 --sysconfdir=/usr/local/etc --with-ssl=openssl --with-libssl-prefix=/usr/local/opt/openssl --disable-iri

==> make install

Warning: Could not link wget. Unlinking...

Error: The brew link step did not complete successfully

The formula built, but is not symlinked into /usr/local

You can try again using `brew link wget'

Possible conflicting files are:

/usr/local/bin/wget

/usr/local/share/man/man1/wget.1

==> Summary

/usr/local/Cellar/wget/1.15: 8 files, 700K, built in 73 seconds

gerryyang@mba:bin$

(3) 如何删除Homebrew?

If you installed to /usr/local then you can use the script in thisgist to uninstall — it will onlyremove Homebrew and the stuff Homebrew installed leaving anything elsein/usr/local alone.

Provided you haven’t put anything else in Homebrew’s prefix(brew --prefix), you can generally justrm -rf that directory. Thisis because Homebrew won’t touch files outside its prefix.

(4) Homebrew下载的package存放的路径在哪里?

gerryyang@mba:bin$brew --cache

/Library/Caches/Homebrew

gerryyang@mba:bin$ls /Library/Caches/Homebrew/

Formula/ wget-1.14.tar.gz

coreutils-8.22.tar.xz wget-1.15.tar.gz

openssl-1.0.1f.mavericks.bottle.tar.gz xz-5.0.5.mavericks.bottle.2.tar.gz

gerryyang@mba:bin$ls /Library/Caches/Homebrew/Formula/

coreutils.brewing openssl.brewing wget.brewing xz.brewing

gerryyang@mba:bin$

(5) 我可以安装自己的stuff在/usr/local吗?

Yes, brew is designed to not get in your way so you can use it how youlike.

Install your own stuff, but be aware that if you install commonlibraries, like libexpat yourself, it may cause trouble when trying tobuild certain Homebrew formula. As a resultbrew doctor will warn youabout this.

Thus it’s probably better to install your own stuff to the Cellar andthen brew link it. Like so:

$ cd foo-0.1
$ brew diy
./configure —prefix=/usr/local/Cellar/foo/0.1
$ ./configure —prefix=/usr/local/Cellar/foo/0.1
[snip]
$ make && make install
$ brew link foo
Linking /usr/local/Cellar/foo/0.1… 17 symlinks created
在我的环境上检测是这样的:

gerryyang@mba:bin$brew doctor

Warning: Unbrewed dylibs were found in /usr/local/lib.

If you didn't put them there on purpose they could cause problems when

building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:

/usr/local/lib/libboost_atomic.dylib

/usr/local/lib/libboost_chrono.dylib

/usr/local/lib/libboost_context.dylib

/usr/local/lib/libboost_date_time.dylib

/usr/local/lib/libboost_filesystem.dylib

/usr/local/lib/libboost_graph.dylib

/usr/local/lib/libboost_iostreams.dylib

/usr/local/lib/libboost_locale.dylib

/usr/local/lib/libboost_log.dylib

/usr/local/lib/libboost_math_c99.dylib

/usr/local/lib/libboost_math_c99f.dylib

/usr/local/lib/libboost_math_c99l.dylib

/usr/local/lib/libboost_math_tr1.dylib

/usr/local/lib/libboost_math_tr1f.dylib

/usr/local/lib/libboost_math_tr1l.dylib

/usr/local/lib/libboost_prg_exec_monitor.dylib

/usr/local/lib/libboost_program_options.dylib

/usr/local/lib/libboost_python.dylib

/usr/local/lib/libboost_random.dylib

/usr/local/lib/libboost_regex.dylib

/usr/local/lib/libboost_serialization.dylib

/usr/local/lib/libboost_signals.dylib

/usr/local/lib/libboost_system.dylib

/usr/local/lib/libboost_thread.dylib

/usr/local/lib/libboost_timer.dylib

/usr/local/lib/libboost_unit_test_framework.dylib

/usr/local/lib/libboost_wave.dylib

/usr/local/lib/libboost_wserialization.dylib

Warning: Unbrewed static libraries were found in /usr/local/lib.

If you didn't put them there on purpose they could cause problems when

building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:

/usr/local/lib/libboost_atomic.a

/usr/local/lib/libboost_chrono.a

/usr/local/lib/libboost_context.a

/usr/local/lib/libboost_coroutine.a

/usr/local/lib/libboost_date_time.a

/usr/local/lib/libboost_exception.a

/usr/local/lib/libboost_filesystem.a

/usr/local/lib/libboost_graph.a

/usr/local/lib/libboost_iostreams.a

/usr/local/lib/libboost_locale.a

/usr/local/lib/libboost_log.a

/usr/local/lib/libboost_math_c99.a

/usr/local/lib/libboost_math_c99f.a

/usr/local/lib/libboost_math_c99l.a

/usr/local/lib/libboost_math_tr1.a

/usr/local/lib/libboost_math_tr1f.a

/usr/local/lib/libboost_math_tr1l.a

/usr/local/lib/libboost_prg_exec_monitor.a

/usr/local/lib/libboost_program_options.a

/usr/local/lib/libboost_python.a

/usr/local/lib/libboost_random.a

/usr/local/lib/libboost_regex.a

/usr/local/lib/libboost_serialization.a

/usr/local/lib/libboost_signals.a

/usr/local/lib/libboost_system.a

/usr/local/lib/libboost_test_exec_monitor.a

/usr/local/lib/libboost_thread.a

/usr/local/lib/libboost_timer.a

/usr/local/lib/libboost_unit_test_framework.a

/usr/local/lib/libboost_wave.a

/usr/local/lib/libboost_wserialization.a

Warning: You have unlinked kegs in your Cellar

Leaving kegs unlinked can lead to build-trouble and cause brews that depend on

those kegs to fail to run properly once built. Run brew link on these:

wget  

gerryyang@mba:bin$

(6) 为什么选择Homebrew这个名字?
mxcl was too concerned with the beer theme and didn’t consider that the project may actually prove popular. By the time he realized it was too late. However, today, the first google hit for “homebrew” is not beer related ;-)

看来作者是个酒鬼!

(7) 关于更多地QA可以参考Homebrew的Wiki[4]

(8) 一些常用安装推荐

gerryyang@mba:bin$brew list

coreutils openssl wget xz

Introduction to Coreutils

The GNU Core Utilities are the basic file, shell and text manipulationutilities of the GNU operating system.
These are the core utilitieswhich are expected to exist on every operating system.

http://www.gnu.org/software/coreutils/

4 参考

[1] http://brew.sh/index_zh-cn.html

[2] https://github.com/Homebrew/homebrew/wiki/Installation

[3] https://github.com/Homebrew/homebrew/wiki/FAQ

[4] https://github.com/Homebrew/homebrew/wiki

cxzlzy
cxzlzy 我已经有 Homebrew 了,是更新之后其他的库检测不到新版本 XD
4 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
关于mac安装homebrew报错!急急急!求大佬帮助!!!

![图片说明](https://img-ask.csdn.net/upload/201808/08/1533739819_318511.png) 这个问题要怎么解决,实在是无能为力了,求帮助

我的mac笔记本安装homebrew出现问题

-bash-3.2$ brew /usr/local/Library/Homebrew/global.rb:109:in `force_encoding': can't modify frozen String (RuntimeError) from /usr/local/Library/Homebrew/global.rb:109:in `<top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /usr/local/Library/brew.rb:16:in `<main>' 这是什么问题

关于homebrew安装后仍然出现-bash: brew: command not found的问题

请教下各位,该如何解决这个问题 我的操作步骤如下: 1.安装好官网的homebrew后,发现输入brew 仍然出现-bash: brew: command not found报错,于是开始找方法。 2.发现一种问题和我很像,但是我用后一直没有解决,方法如下: ![图片说明](https://img-ask.csdn.net/upload/202003/12/1584026467_416063.jpg) 3.我操作后,还是不会修改……并出现如下情况: ![图片说明](https://img-ask.csdn.net/upload/202003/12/1584026557_452584.jpg)于是,我就卡在这里了……求各位指点

Mac用homebrew安装opencv但是总有一个错误

![图片说明](https://img-ask.csdn.net/upload/201801/12/1515752539_800318.png)

Mac Yosemite上使用dnsmasq和homebrew AMP堆栈的localhost问题

<div class="post-text" itemprop="text"> <p>I'm having a major issue. I have had a stable and working AMP stack installed via homebrew with DNSMASQ dynamic domains.</p> <p>Today, I booted my mac to find that Safar, Chrome and all web browsers report that they cannot load the local dev sites (any of them) because the server cannot be found.</p> <p>I checked on the command line and the domain names are properly resolving and pinging back.</p> <pre><code>➜ ping blck3.dev PING blck3.dev (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.068 ms 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.075 ms 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.095 ms 64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.082 ms 64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.053 ms --- blck3.dev ping statistics --- 5 packets transmitted, 5 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 0.053/0.075/0.095/0.014 ms </code></pre> <p>I then decided to check my apache config for errors and I get the following:</p> <pre><code>➜ httpd -v Server version: Apache/2.4.10 (Unix) Server built: Jan 8 2015 20:48:33 ➜ apachectl configtest httpd: Syntax error on line 171 of /private/etc/apache2/httpd.conf: Cannot load /usr/local/opt/php55/libexec/apache2/libphp5.so into server: dlopen(/usr/local/opt/php55/libexec/apache2/libphp5.so, 10): Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.54.dylib Referenced from: /usr/local/opt/php55/libexec/apache2/libphp5.so Reason: image not found </code></pre> <p>So, I decided to reinstall php55 as some people have reported that reinstalling php55 will solve the issue, but homebrew reports that there is no such formula.</p> <pre><code>/usr/local/opt ➜ brew info php55 Error: No available formula for php55 ✘ /usr/local/opt ➜ brew info php56 Error: No available formula for php56 ✘ /usr/local/opt </code></pre> <p>I then did a search to see if I was having any issues specific to my machine wherein I couldn't see the php formulae:</p> <pre><code>➜ brew search php php53-sodium php54-sodium php55-sodium php56-sodium virtphp Caskroom/cask/eclipse-php Caskroom/cask/netbeans-php Caskroom/cask/phpstorm </code></pre> <p>I was surprised that neither php55, php55-mcrypt, php56 nor php56-mcrypt were available.</p> <p>So, I checked to make sure all the relevant taps are properly tapped:</p> <pre><code>➜ brew tap homebrew/dupes Warning: Already tapped! /usr/local/opt ➜ brew tap homebrew/versions Warning: Already tapped! /usr/local/opt ➜ brew tap homebrew/homebrew-php Warning: Already tapped! </code></pre> <p>I then ran brew doctor which gives me the following error:</p> <pre><code>➜ brew doctor Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry and just ignore them. Thanks! Warning: You have unlinked kegs in your Cellar Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run `brew link` on these: binutilsfb cloog018 gmp4 isl011 libmpc08 mpfr2 rar </code></pre> <p>I have no idea what has gone wrong, because everything was working fine on Friday, nothing was touched over the weekend, and as of this morning...nothing seems to work properly.</p> <p>Please advise, as this is a major problem for me and which I need to resolve ASAP.</p> <p>Thank you,</p> <p>Ali</p> </div>

homebrew安装中密码是什么?

在homebrew安装的时候,password后面不能输入东西,按回车回提示sorry。请问这怎么解决?

Mac安装Homebrew 报错Syntax Error

运行 brew_install.sh ``` /bin/bash ./brew_install ``` brew_install.sh 里面的代码: ![图片说明](https://img-ask.csdn.net/upload/202005/09/1589015465_863785.png) 报错: ![图片说明](https://img-ask.csdn.net/upload/202005/09/1589015540_615332.png)

无法在mac high sierra的homebrew上找到pcntl

<div class="post-text" itemprop="text"> <p>I have been trying to install pcntl extension using homebrew in MacOS High sierra using command</p> <pre><code>brew install homebrew/php/php71-pcntl brew install homebrew-php/php71-pcntl </code></pre> <p>Also tried with php54, 55, 56, 70 I m getting error</p> <p>Updating Homebrew...</p> <pre><code>Error: No available formula with the name "homebrew/php/php7-pcntl" ==&gt; Searching for a previously deleted formula (in the last month)... Warning: homebrew/php is shallow clone. To get complete history run: git -C "$(brew --repo homebrew/php)" fetch --unshallow Error: No previously deleted formula found. ==&gt; Searching for similarly named formulae... ==&gt; Searching local taps... Error: No similarly named formulae found. </code></pre> <p>Why its not finding the formulae on my Mac I have php 7.1.14 on my mac</p> </div>

OS系统,Homebrew安装显示要输入password,可我电脑没有设置密码,求帮助

1. OS系统,Homebrew安装显示要输入password,可我电脑没有设置密码,求帮助 2.

Homebrew安装的PHP7不适用于macOS上的Apache

<div class="post-text" itemprop="text"> <p>I am trying to upgrade to php7 which I installed via homebrew.</p> <p>In CLI php -v returns </p> <pre><code>PHP 7.0.10 (cli) (built: Aug 21 2016 19:14:33) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies </code></pre> <p>But for localhost, firefox pops up a problem loading page, and I can't view a localhost/phpinfo.php; if I swap the module lines out back to php5 it works fine.</p> <p>Here's a pastebin <a href="http://pastebin.com/950yC7wA" rel="noreferrer">http://pastebin.com/950yC7wA</a> of my apache2/httpd.conf, I have no idea how to go about fixing this.</p> <ul> <li>osx version El Capitan 10.11</li> </ul> </div>

无法在macOS Sierra上安装带有Homebrew的PHP 7

<div class="post-text" itemprop="text"> <p>I'm trying to setup Laravel's Valet which, as a dependency, requires PHP 7. When I try to install PHP 7 with Homebrew I get the following error:</p> <pre><code>Configuring SAPI modules checking for Apache 2.0 handler-module support via DSO through APXS... Sorry, I cannot run apxs. Possible reasons follow: 1. Perl is not installed 2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs 3. Apache was not built using --enable-so (the apxs usage page is displayed) The output of /usr/sbin/apxs follows: apxs:Error: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/apr-1-config not found!. configure: error: Aborting READ THIS: https://git.io/brew-troubleshooting If reporting this issue please do so at (not Homebrew/brew): https://github.com/Homebrew/homebrew-php/issues These open issues may also help: php70-dbase https://github.com/Homebrew/homebrew-php/issues/3508 php70-intl not found https://github.com/Homebrew/homebrew-php/issues/3591 php70-opcache install issue https://github.com/Homebrew/homebrew-php/issues/3586 Problem installing php70-mcrypt, php70-opcache, php70-xdebug on El Capitan https://github.com/Homebrew/homebrew-php/issues/3587 Add php70-zmq formula https://github.com/Homebrew/homebrew-php/pull/3474 Problem installing homebrew/php/php70-imagick https://github.com/Homebrew/homebrew-php/issues/3571 Install PHP70: Incompatible library version https://github.com/Homebrew/homebrew-php/issues/3444 brew install php70-redis https://github.com/Homebrew/homebrew-php/issues/2762 Allow --enable-redis-igbinary for php70-redis https://github.com/Homebrew/homebrew-php/pull/3473 Add head formula for php70-uploadprogress https://github.com/Homebrew/homebrew-php/pull/3178 </code></pre> <p>This is on a fresh install of macOS Sierra (actual release, <strong>not</strong> a beta) with a fresh install of Homebrew (updated). I have installed, ran and agreed to the Xcode licensing agreement.</p> <p>I have no idea what these errors mean or how to fix them. Can anyone offer any help?</p> <p>Thanks.</p> </div>

通过composer在mac os上安装laravel

<div class="post-text" itemprop="text"> <p>I need to use lavarel on mac os. I first installed MAMP. After that, following instructions on laravel.com, I installed composer globally via homebrew. Now, when I change my directory to /Applications/ MAMP/htdocs and try <code>composer create-project laravel/laravel myname</code> on the terminal, nothing happens even after half an hour. I also tried downloading lavarel-master manually,putting the content in htdocs and <code>composer install</code> .Again nothing in .5 hour. I have done <code>composer self-update</code> and checked <code>composer diag</code> and all is OK. Upon trying <code>which php</code> ,i get <code>/Applications/MAMP/bin/php/php5.5.10/bin/php</code> I also restarted mac and tried the commands again,but same result.</p> <p>Please help ,I am new to php and don't know how to proceed.</p> <p>PS:Upon trying <code>composer install</code> in laravel master directory the following appears on terminal:<code> Loading composer repositories with package information Installing dependencies (including require-dev)</code> and then only the cursor blinks, nothing happening. Is that a trouble with my composer or laravel installation?</p> </div>

请教下,homebrew装好后输入命令,一直提示command not found,如何解决

请教下,homebrew装好后输入命令,一直提示command not found,如何解决

Homebrew升级后,MySQL服务器已经消失

<div class="post-text" itemprop="text"> <p>I just did a <code>brew upgrade</code> to PHP 7.2.8 and MySQL 8.0.12. After this, trying to connect to MySQL from a PHP script (from Bash) times out after 10 seconds (the default MySQL timeout value).</p> <pre><code>new PDO("mysql:host=localhost;dbname=foo;charset=utf8", "user", "pass"); [2006] MySQL server has gone away </code></pre> <p>Everything in my environment seems to be normal. I haven't changed anything else in my setup. Connecting to MySQL from Bash works fine. How do I regain MySQL access from PHP?</p> <pre><code>$ php -i | grep php.ini Configuration File (php.ini) Path =&gt; /usr/local/etc/php/7.2 Loaded Configuration File =&gt; /usr/local/etc/php/7.2/php.ini $ tail /usr/local/etc/php/7.2/php.ini mysql.default_socket = /tmp/mysql.sock pdo_mysql.default_socket = /tmp/mysql.sock $ ls /tmp/mysql* srwxrwxrwx 0 /tmp/mysql.sock -rw------- 5 /tmp/mysql.sock.lock srwxrwxrwx 0 /tmp/mysqlx.sock -rw------- 6 /tmp/mysqlx.sock.lock $ mysql Welcome to the MySQL monitor. mysql&gt; show variables like '%socket%'; +-----------------------------------------+------------------+ | mysqlx_socket | /tmp/mysqlx.sock | | socket | /tmp/mysql.sock | +-----------------------------------------+------------------+ </code></pre> </div>

Homebrew 安装时提示需要当前用户是管理员

![图片说明](https://img-ask.csdn.net/upload/201811/21/1542770388_681847.png) 因为其他一些原因,我卸载了Homebrew(脑子抽了),准备重新安装,结果就这样了。 前面我修改过 /usr/lcoal这个文件夹的权限,因此似乎对 /usr/local/bin 下的ruby有了影响。

icu4c - 使用Homebrew安装Yosemite后更新/安装php

<div class="post-text" itemprop="text"> <p>I just upgraded to Yosemite. I was using Apache 2.2, but the upgrade included 2.4. After some configuration nightmares, I ended up reinstalling 2.4 using Homebrew. I have it mostly configured. However, when I use the old httpd.conf settings for php, I get the following error:</p> <blockquote> <p>Symbol not found: _unixd_config Referenced from: /usr/local/opt/php55/libexec/apache2/libphp5.so Expected in: /usr/local/Cellar/httpd24/2.4.10/bin/httpd in /usr/local/opt/php55/libexec/apache2/libphp5.so</p> </blockquote> <p>When running <code>brew upgrade php55</code> I get the following error when updating icu4c:</p> <pre><code>==&gt; Upgrading icu4c ==&gt; Downloading http://download.icu-project.org/files/icu4c/54.1/icu4c-54_1-src.tgz Already downloaded: /Library/Caches/Homebrew/icu4c-54.1.tgz Error: SHA1 mismatch Expected: 8c752490bbf31cea26e20246430cee67d48abe34 Actual: d625398a0d5cb34a0b5b2c4ab577e3b1957fb460 Archive: /Library/Caches/Homebrew/icu4c-54.1.tgz To retry an incomplete download, remove the file above. </code></pre> <p>Removing the file does not help. I've ran <code>brew doctor</code>, which gives me this concerning php:</p> <pre><code>Warning: "config" scripts exist outside your system or Homebrew directories. `./configure` scripts often look for *-config scripts to determine if software packages are installed, and what additional flags to use when compiling and linking. Having additional scripts in your path can confuse software installed via Homebrew if the config script overrides a system or Homebrew provided script of the same name. We found the following "config" scripts: /usr/local/opt/php55/bin/php-config </code></pre> <p>Not sure how to proceed. I've tried to install php56, but it needs the same dependency. Seems to be a icu4c issue, but this is kind of unchartered territory for me. Thanks</p> </div>

使用Homebrew安装Go项目时出错

<div class="post-text" itemprop="text"> <p>Now I try to install any <code>go</code> project with <code>brew</code> but I get the same error</p> <pre><code>➜ brew install etcd ==&gt; Installing etcd dependency: go ==&gt; Downloading https://storage.googleapis.com/golang/go1.4.src.tar.gz Already downloaded: /Library/Caches/Homebrew/go-1.4.tar.gz ==&gt; ./make.bash --no-clean ==&gt; ./make.bash --no-clean ==&gt; ./make.bash --no-clean ==&gt; ./make.bash --no-clean ==&gt; ./make.bash --no-clean ==&gt; ./make.bash --no-clean ==&gt; ./make.bash --no-clean ==&gt; ./make.bash --no-clean ==&gt; ./make.bash --no-clean ==&gt; ./make.bash --no-clean ==&gt; ./make.bash --no-clean ==&gt; ./make.bash --no-clean ==&gt; ./make.bash --no-clean ==&gt; ./make.bash --no-clean ==&gt; ./make.bash --no-clean ... </code></pre> </div>

Mac OS 下MYSQL 的mysql.sock问题

情况描述:安装在Mac下的MySQL。刚安装完MySQL可以运行可以使用。在使用完MySQL 后,我会通过系统偏好设置里的按钮关闭MySQL Server。然后过一段时间再使用时就会出现 不能通过/tmp/mysql.sock建立连接这样的提示。然后我去到/tmp目录下,发现不存在mysql.sock文件。 在重新安装MySQL后,在/tmp目录下会重新出现mysql.sock文件。下面是我的提问,希望大家能为我 解答: 1.为什么mysql.sock会消失,重新安装后又会出现 2.网上说MySQL的默认sock路径和Mac下是不一样的。这里我非常不明白。在安装的时候把 mysql.sock安装在Mac的默认sock路径下,然后启动MySQL时又从MySQL的默认路径下找sock, 我这样的理解对吗?求解释 3.我该如何解决该问题。感觉主要问题就是/tmp/mysql.sock会自己消失。如何解决这个问题呢?

homebrew安装mysql 5.7,临时密码存到哪里去了

如题,好像是5.7.6以后的mysql,使用dmg安装的话,会有一个默认的临时密码,如果用homebrew安装的话,这个密码不知道存放到哪了

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Intellij IDEA 实用插件安利

1. 前言从2020 年 JVM 生态报告解读 可以看出Intellij IDEA 目前已经稳坐 Java IDE 头把交椅。而且统计得出付费用户已经超过了八成(国外统计)。IDEA 的...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

魂迁光刻,梦绕芯片,中芯国际终获ASML大型光刻机

据羊城晚报报道,近日中芯国际从荷兰进口的一台大型光刻机,顺利通过深圳出口加工区场站两道闸口进入厂区,中芯国际发表公告称该光刻机并非此前盛传的EUV光刻机,主要用于企业复工复产后的生产线扩容。 我们知道EUV主要用于7nm及以下制程的芯片制造,光刻机作为集成电路制造中最关键的设备,对芯片制作工艺有着决定性的影响,被誉为“超精密制造技术皇冠上的明珠”,根据之前中芯国际的公报,目...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

差点跪了...

最近微信又搞出了一个大利器,甚至都上了热搜,当然消息最敏捷的自媒体人,纷纷都开通了自己的视频号。01 视频号是什么呢?视频号是微信体系内的短视频,它不同...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

Vue回炉重造之router路由(更新中)

你好,我是Vam的金豆之路,可以叫我豆哥。2019年年度博客之星、技术领域博客专家。主要领域:前端开发。我的微信是 maomin9761,有什么疑问可以加我哦,自己创建了一个微信技术交流群,可以加我邀请你一起交流学习。最后自己也创建了一个微信公众号,里面的文章是我自己精挑细选的文章,主要介绍各种IT新技术。欢迎关注哦,微信搜索:臻美IT,等你来。 欢迎阅读本博文,本博文主要讲述【】,文字通...

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

大胆预测下未来5年的Web开发

在2019年的ReactiveConf 上,《Elm in Action》的作者Richard Feldman对未来5年Web开发的发展做了预测,很有意思,分享给大家。如果你有机会从头...

立即提问
相关内容推荐