douju9847 2015-05-11 13:35
浏览 59

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

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

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.

/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

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!
/usr/local/opt
➜  brew tap homebrew/versions
Warning: Already tapped!
/usr/local/opt
➜  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:

    binutilsfb
    cloog018
    gmp4
    isl011
    libmpc08
    mpfr2
    rar

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,

Ali

  • 写回答

1条回答

  • dou2347 2015-07-03 07:20
    关注

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

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 luckysheet
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱