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

I'm having a major issue. I have had a stable and working AMP stack installed via homebrew with DNSMASQ dynamic domains.

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.

I checked on the command line and the domain names are properly resolving and pinging back.

➜  ping
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=64 time=0.068 ms
64 bytes from icmp_seq=1 ttl=64 time=0.075 ms
64 bytes from icmp_seq=2 ttl=64 time=0.095 ms
64 bytes from icmp_seq=3 ttl=64 time=0.082 ms
64 bytes from icmp_seq=4 ttl=64 time=0.053 ms

--- 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

I then decided to check my apache config for errors and I get the following:

➜  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/ into server: dlopen(/usr/local/opt/php55/libexec/apache2/, 10): Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.54.dylib
  Referenced from: /usr/local/opt/php55/libexec/apache2/
  Reason: image not found

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.

➜  brew info php55
Error: No available formula for php55
✘ /usr/local/opt
➜  brew info php56
Error: No available formula for php56
✘ /usr/local/opt

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:

➜  brew search php
php53-sodium   php54-sodium   php55-sodium   php56-sodium   virtphp
Caskroom/cask/eclipse-php     Caskroom/cask/netbeans-php    Caskroom/cask/phpstorm

I was surprised that neither php55, php55-mcrypt, php56 nor php56-mcrypt were available.

So, I checked to make sure all the relevant taps are properly tapped:

➜  brew tap homebrew/dupes
Warning: Already tapped!
➜  brew tap homebrew/versions
Warning: Already tapped!
➜  brew tap homebrew/homebrew-php
Warning: Already tapped!

I then ran brew doctor which gives me the following error:

➜  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:


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.

Please advise, as this is a major problem for me and which I need to resolve ASAP.

Thank you,



正如您提到的这一行所说:</ p>

  httpd:171行语法错误 /private/etc/apache2/httpd.conf:无法将/usr/local/opt/php55/libexec/apache2/libphp5.so加载到server:dlopen(/ usr / local / opt / php55 / libexec / apache2 / libphp5。 所以,10):库未加载:/usr/local/opt/icu4c/lib/libicui18n.54.dylib
原因: 找不到图像
</ code> </ pre>

问题是由更新的 icu4c </ em>库引起的。 libicui18n.54.dylib </ em>是这里的问题。</ p>

它已被提交为一个 homebrew-php </ em> bug#1701 ,解决方案就是使用</ p>重新安装PHP

< pre> brew重新安装php53
</ code> </ pre>

php55 </ code>或 php56 </ code>,具体取决于您使用的是哪个版本 。 一些评论者建议可能需要通过运行</ p>

  brew重新安装php53 -fs 
</ code> </ pre>

甚至更好</ p>

  brew重新安装php53 --build-from-source 
</ code> </ pre>

对我而言 ,只需要调用 brew重新安装php53 </ code>就可以了,它已经从源代码自动构建。 根据 alanthing的评论从5月11日开始,不会出现此问题 即使 icu4c </ em>再次更新,将来还有更多。</ p>
</ div>



As this line you mentioned says:

httpd: Syntax error on line 171 of /private/etc/apache2/httpd.conf: Cannot load /usr/local/opt/php55/libexec/apache2/ into server: dlopen(/usr/local/opt/php55/libexec/apache2/, 10): Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.54.dylib
  Referenced from: /usr/local/opt/php55/libexec/apache2/
  Reason: image not found

The problem is caused by an updated icu4c library. The libicui18n.54.dylib is the problem here.

It has been alredy filed as a homebrew-php bug #1701 and a solution is just to reinstall PHP using

brew reinstall php53

or php55 or php56 depending on which version you are using. Some commenters suggest that it might be needed to force reinstalling from source code by running

brew reinstall php53 -fs

or even better

brew reinstall php53 --build-from-source

For me, however, it was enough just to call brew reinstall php53 and it has been built from source automatically. According to alanthing’s comment from May 11, this issue shall not arise any more in the future, even if icu4c gets updated again.

Csdn user default icon