This repository has been archived by the owner. It is now read-only.

php56-mongodb _clock_gettime error at runtime #3737

Closed
bfontaine opened this Issue Oct 26, 2016 · 51 comments

Comments

Projects
None yet
@bfontaine
Member

bfontaine commented Oct 26, 2016

From @ABXAdmin on October 24, 2016 20:51

If Homebrew was updated on Aug 10-11th 2016 and brew update always says Already up-to-date. you need to run: cd "$(brew --repo)" && git fetch && git reset --hard origin/master && brew update.

Please follow the general troubleshooting steps first:

  • Ran brew update and retried your prior step?
  • Ran brew doctor, fixed as many issues as possible and retried your prior step?
  • If you're seeing permission errors tried running sudo chown -R $(whoami) $(brew --prefix)?

The error:

dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
  Referenced from: /usr/local/opt/php56-mongodb/mongodb.so
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _clock_gettime
  Referenced from: /usr/local/opt/php56-mongodb/mongodb.so
  Expected in: /usr/lib/libSystem.B.dylib

Trace/BPT trap: 5

I followed the troubleshooting instructions, uninstalled and reinstalled php56 and php56-mongodb and am still getting this error. I know this is related to many other tickets, but the methods shown in the other tickets to fix the issue didn't help.

I've got xcode v8 installed with the v7.3x CLT.

I am unsure as to the brew doctor results. I get many warnings, but they appear to be due to having installed quite a bit outside of homebrew. Everything seems to work correctly except for the php56-mongodb driver. The legacy php56-mongo driver continues to work. I do have unbrewed dylibs but am unsure if one, or many of them may be causing an issue here:

Unexpected delis:

  /usr/local/lib/dccmtr.dylib
  /usr/local/lib/libCalibrationHandler.dylib
  /usr/local/lib/libCIEHandler.dylib
  /usr/local/lib/libCompression.dylib
  /usr/local/lib/libcurl.4.dylib
  /usr/local/lib/libDeviceManager.dylib
  /usr/local/lib/libErrorHandler.dylib
  /usr/local/lib/libICMManager.dylib
  /usr/local/lib/libMCCAppManager.dylib
  /usr/local/lib/libMCCEngineWrapper.dylib
  /usr/local/lib/libmcrypt.4.4.8.dylib
  /usr/local/lib/libMonitorDDCCISDK.dylib
  /usr/local/lib/libProtocolEngine.dylib
  /usr/local/lib/libQM2Lib.dylib
  /usr/local/lib/libssh2.1.dylib
  /usr/local/lib/Spyder.dylib
  /usr/local/lib/Spyder3.dylib

Copied from original issue: Homebrew/homebrew-core#6236

@bfontaine bfontaine referenced this issue Oct 26, 2016

Closed

php56-mongodb _clock_gettime error at runtime #6236

0 of 3 tasks complete
@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Oct 26, 2016

Member

@ABXAdmin which OS are you on ? El Cap ?
Are you installing from bottle or compiling from source ?

Member

javian commented Oct 26, 2016

@ABXAdmin which OS are you on ? El Cap ?
Are you installing from bottle or compiling from source ?

@ABXAdmin

This comment has been minimized.

Show comment
Hide comment
@ABXAdmin

ABXAdmin Oct 27, 2016

El Cap

Installing via:

brew install php56 —with-apache
brew install php56-mongodb

ABXAdmin commented Oct 27, 2016

El Cap

Installing via:

brew install php56 —with-apache
brew install php56-mongodb
@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Oct 27, 2016

Member

@ABXAdmin I've been reading about a similar error in mobile-shell/mosh#807 which seems to be the root cause of this issue.

Have you tried to reinstall from source on your machine ?
Have you tried to rerun xcode-select --install and then try to install the bottle again ?
If that doesn't work, try once more to install mongodb from source

Member

javian commented Oct 27, 2016

@ABXAdmin I've been reading about a similar error in mobile-shell/mosh#807 which seems to be the root cause of this issue.

Have you tried to reinstall from source on your machine ?
Have you tried to rerun xcode-select --install and then try to install the bottle again ?
If that doesn't work, try once more to install mongodb from source

@ABXAdmin

This comment has been minimized.

Show comment
Hide comment
@ABXAdmin

ABXAdmin Nov 2, 2016

@javian

got busy for a little while...

I did run xcode-select --install, but got the message that everyone else reports that

command line tools are already installed, use Software Update to install updates.

I took a look at the external issue and it appears to be an environment issue there.

I'm hoping not to have to install from source as I'm trying to keep several php environments in brew and to switch back and forth. FYI, the php70-mongodb driver has the same issue. I'd like to have to keep from messing with the apache configs for each environment as I can get by with the legacy driver for a while.

ABXAdmin commented Nov 2, 2016

@javian

got busy for a little while...

I did run xcode-select --install, but got the message that everyone else reports that

command line tools are already installed, use Software Update to install updates.

I took a look at the external issue and it appears to be an environment issue there.

I'm hoping not to have to install from source as I'm trying to keep several php environments in brew and to switch back and forth. FYI, the php70-mongodb driver has the same issue. I'd like to have to keep from messing with the apache configs for each environment as I can get by with the legacy driver for a while.

@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Nov 11, 2016

Member

@ABXAdmin It seems that clock_gettime has seen several issues since the introduction of XCode 8, as an example you can look at this formula - Homebrew/homebrew-core#6118 and there's plenty more to find in the homebrew-core repo. Not sure what to do about it at this stage though.

Member

javian commented Nov 11, 2016

@ABXAdmin It seems that clock_gettime has seen several issues since the introduction of XCode 8, as an example you can look at this formula - Homebrew/homebrew-core#6118 and there's plenty more to find in the homebrew-core repo. Not sure what to do about it at this stage though.

@cdekok

This comment has been minimized.

Show comment
Hide comment
@cdekok

cdekok Nov 15, 2016

I am getting the same error on PHP 7 with mongo.

dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
  Referenced from: /usr/local/opt/php70-mongodb/mongodb.so
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _clock_gettime
  Referenced from: /usr/local/opt/php70-mongodb/mongodb.so
  Expected in: /usr/lib/libSystem.B.dyli

It looks like some other software has problem due to an xcode update too.

Homebrew/homebrew-core#2674
Homebrew/homebrew-core#4902

cdekok commented Nov 15, 2016

I am getting the same error on PHP 7 with mongo.

dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
  Referenced from: /usr/local/opt/php70-mongodb/mongodb.so
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _clock_gettime
  Referenced from: /usr/local/opt/php70-mongodb/mongodb.so
  Expected in: /usr/lib/libSystem.B.dyli

It looks like some other software has problem due to an xcode update too.

Homebrew/homebrew-core#2674
Homebrew/homebrew-core#4902

@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Nov 15, 2016

Member

@cdekok @ABXAdmin I would still ask you to test brew reinstall -s php70-mongodb if you are using 7.0 just to see if its a build problem with the bottles.

Member

javian commented Nov 15, 2016

@cdekok @ABXAdmin I would still ask you to test brew reinstall -s php70-mongodb if you are using 7.0 just to see if its a build problem with the bottles.

@cdekok

This comment has been minimized.

Show comment
Hide comment
@cdekok

cdekok Nov 17, 2016

@javian Still the same error, i have tried uninstall / install / doctor also but nothing seemed to work.

cdekok commented Nov 17, 2016

@javian Still the same error, i have tried uninstall / install / doctor also but nothing seemed to work.

@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Nov 17, 2016

Member

@cdekok thanks for checking. It needs to be raised with the mongodb maintainers since it needs to be updated in the source as far as I can tell - can one of you open a ticket in the php mongodb repo?

Member

javian commented Nov 17, 2016

@cdekok thanks for checking. It needs to be raised with the mongodb maintainers since it needs to be updated in the source as far as I can tell - can one of you open a ticket in the php mongodb repo?

@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Nov 17, 2016

Member

Have any of you tried the devel version (or head) ?

Member

javian commented Nov 17, 2016

Have any of you tried the devel version (or head) ?

@cdekok

This comment has been minimized.

Show comment
Hide comment
@cdekok

cdekok Nov 17, 2016

@javian how can i install the devel version? I tried to install it with pecl itself but get a few errors on openssl. (openssl is installed with brew)

cdekok commented Nov 17, 2016

@javian how can i install the devel version? I tried to install it with pecl itself but get a few errors on openssl. (openssl is installed with brew)

@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Nov 17, 2016

Member

@cdekok use brew install --devel formulaname or brew install --head formulaname

Member

javian commented Nov 17, 2016

@cdekok use brew install --devel formulaname or brew install --head formulaname

@cdekok

This comment has been minimized.

Show comment
Hide comment
@cdekok

cdekok Nov 17, 2016

thx it didn't work either, I have added a bug report on the mongo tracker: https://jira.mongodb.org/browse/PHPC-836

cdekok commented Nov 17, 2016

thx it didn't work either, I have added a bug report on the mongo tracker: https://jira.mongodb.org/browse/PHPC-836

@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Nov 17, 2016

Member

@cdekok after you install from source - can you run brew gist-logs php56-mongodb and share the logs ?

Member

javian commented Nov 17, 2016

@cdekok after you install from source - can you run brew gist-logs php56-mongodb and share the logs ?

@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Nov 17, 2016

Member

@cdekok another thing to test would be to install php56 from source first brew reinstall -s php56 and then try to install mongodb from source again.

Member

javian commented Nov 17, 2016

@cdekok another thing to test would be to install php56 from source first brew reinstall -s php56 and then try to install mongodb from source again.

@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Nov 17, 2016

Member

@cdekok can you also do otool -L /usr/local/opt/php56-mongodb/mongodb.so

Member

javian commented Nov 17, 2016

@cdekok can you also do otool -L /usr/local/opt/php56-mongodb/mongodb.so

@cdekok

This comment has been minimized.

Show comment
Hide comment
@cdekok

cdekok Nov 18, 2016

@javian here is the log: https://gist.github.com/cdekok/4ede3d063678eb35a8d7af687f0ab467

Reinstalled PHP 7 and Mongo didn't work.
Here is the output from otool:

▶ otool -L /usr/local/opt/php70-mongodb/mongodb.so
/usr/local/opt/php70-mongodb/mongodb.so:
    /usr/lib/libsasl2.2.dylib (compatibility version 3.0.0, current version 3.15.0)
    /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)

According to feedback from Mongo it should work without brew: https://jira.mongodb.org/browse/PHPC-836

cdekok commented Nov 18, 2016

@javian here is the log: https://gist.github.com/cdekok/4ede3d063678eb35a8d7af687f0ab467

Reinstalled PHP 7 and Mongo didn't work.
Here is the output from otool:

▶ otool -L /usr/local/opt/php70-mongodb/mongodb.so
/usr/local/opt/php70-mongodb/mongodb.so:
    /usr/lib/libsasl2.2.dylib (compatibility version 3.0.0, current version 3.15.0)
    /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)

According to feedback from Mongo it should work without brew: https://jira.mongodb.org/browse/PHPC-836

@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Nov 18, 2016

Member

@cdekok I saw that feedback as well - the problem here is that it seems that it doesn't happen on all machines. Just to verify, you see the error if you for example list the modules with php -m do you not ?

Member

javian commented Nov 18, 2016

@cdekok I saw that feedback as well - the problem here is that it seems that it doesn't happen on all machines. Just to verify, you see the error if you for example list the modules with php -m do you not ?

@cdekok

This comment has been minimized.

Show comment
Hide comment
@cdekok

cdekok Nov 18, 2016

The error will only show when executing a query:

$query = new MongoDB\Driver\Query($filter, $options);
$cursor = $manager->executeQuery('db.something', $query); // triggers the error

There is no error on php -m

cdekok commented Nov 18, 2016

The error will only show when executing a query:

$query = new MongoDB\Driver\Query($filter, $options);
$cursor = $manager->executeQuery('db.something', $query); // triggers the error

There is no error on php -m

@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Nov 19, 2016

Member

@cdekok can you post that in the jira ticket ? It seems that the test he made only listed the module so it is not clear if he tried to execute a query on a db.

Member

javian commented Nov 19, 2016

@cdekok can you post that in the jira ticket ? It seems that the test he made only listed the module so it is not clear if he tried to execute a query on a db.

@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Nov 19, 2016

Member

@cdekok in the Jira ticket you reported that you were using Sierra but according to your gist you are on El Capitan - is that correct ?

Member

javian commented Nov 19, 2016

@cdekok in the Jira ticket you reported that you were using Sierra but according to your gist you are on El Capitan - is that correct ?

@cdekok

This comment has been minimized.

Show comment
Hide comment
@cdekok

cdekok Nov 22, 2016

@javian yes that is correct I just noticed it the update was not installed correctly, I will try to run it again tonight see if it changes anything.

cdekok commented Nov 22, 2016

@javian yes that is correct I just noticed it the update was not installed correctly, I will try to run it again tonight see if it changes anything.

@guiassemany

This comment has been minimized.

Show comment
Hide comment
@guiassemany

guiassemany Nov 24, 2016

I am with the same problem. Using El Cap.
Any news on this?

guiassemany commented Nov 24, 2016

I am with the same problem. Using El Cap.
Any news on this?

@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Nov 25, 2016

Member

@guiassemany no, there's currently no published solution if you want to stick with El Cap.

Member

javian commented Nov 25, 2016

@guiassemany no, there's currently no published solution if you want to stick with El Cap.

@why-git

This comment has been minimized.

Show comment
Hide comment
@why-git

why-git Nov 25, 2016

Same problem here, on 10.11.6. Xcode-select --version shows 2343.

Dyld Error Message:
  Symbol not found: _clock_gettime
  Referenced from: /usr/local/opt/php56-mongodb/mongodb.so
  Expected in: /usr/lib/libSystem.B.dylib

Really frustrated...

why-git commented Nov 25, 2016

Same problem here, on 10.11.6. Xcode-select --version shows 2343.

Dyld Error Message:
  Symbol not found: _clock_gettime
  Referenced from: /usr/local/opt/php56-mongodb/mongodb.so
  Expected in: /usr/lib/libSystem.B.dylib

Really frustrated...

@josegonzalez

This comment has been minimized.

Show comment
Hide comment
@josegonzalez

josegonzalez Nov 25, 2016

Contributor

@why973828939 Yep, sucks when free software doesn't work as desired.

We'll definitely keep everyone posted here in terms of any possible solutions. At the moment, it seems like the latest version of XCode updated some libraries/headers that are missing a symbol needed for the mongodb extension to work.

I'm pretty sure the mongodb php extension maintainers are hard at work on a fix, but if anyone here has any information on how we might be able to fix it, please do contribute it. Being negative doesn't really help anyone, and mostly just demoralizes the maintainers and makes it less likely that we'll contribute.

@javian could we try the hack mentioned in this comment regarding std_cmake_args? I'll admit I have no idea what that means, but if someone wants to investigate, it's worth a shot.

Contributor

josegonzalez commented Nov 25, 2016

@why973828939 Yep, sucks when free software doesn't work as desired.

We'll definitely keep everyone posted here in terms of any possible solutions. At the moment, it seems like the latest version of XCode updated some libraries/headers that are missing a symbol needed for the mongodb extension to work.

I'm pretty sure the mongodb php extension maintainers are hard at work on a fix, but if anyone here has any information on how we might be able to fix it, please do contribute it. Being negative doesn't really help anyone, and mostly just demoralizes the maintainers and makes it less likely that we'll contribute.

@javian could we try the hack mentioned in this comment regarding std_cmake_args? I'll admit I have no idea what that means, but if someone wants to investigate, it's worth a shot.

@guiassemany

This comment has been minimized.

Show comment
Hide comment
@guiassemany

guiassemany Dec 8, 2016

@Suhkha The solution for me was to update to Sierra with xCode 8.1 and use latest mongodb extension. I needed to keep working on it, so I decided to do it.

guiassemany commented Dec 8, 2016

@Suhkha The solution for me was to update to Sierra with xCode 8.1 and use latest mongodb extension. I needed to keep working on it, so I decided to do it.

@Suhkha

This comment has been minimized.

Show comment
Hide comment
@Suhkha

Suhkha Dec 8, 2016

@guiassemany thanks! The problem is... I can't for now do that update...it's not up to me to make the change. :(
Thanks.

Suhkha commented Dec 8, 2016

@guiassemany thanks! The problem is... I can't for now do that update...it's not up to me to make the change. :(
Thanks.

@dariuszmaciejewski

This comment has been minimized.

Show comment
Hide comment
@dariuszmaciejewski

dariuszmaciejewski Dec 27, 2016

I run El Captain too, but I updated XCode Command Line Tools to the version 2343 (xcode-select --version):

softwareupdate --install -a

(it installs all software updates)
and next I installed the extension with the --build-from-source flag:

brew install --build-from-source php70-mongodb

the issue seems to be gone now.

dariuszmaciejewski commented Dec 27, 2016

I run El Captain too, but I updated XCode Command Line Tools to the version 2343 (xcode-select --version):

softwareupdate --install -a

(it installs all software updates)
and next I installed the extension with the --build-from-source flag:

brew install --build-from-source php70-mongodb

the issue seems to be gone now.

@jgrossi

This comment has been minimized.

Show comment
Hide comment
@jgrossi

jgrossi Jan 3, 2017

@dmaciej It worked for me as well, same env, but I'm using php 5.6! Really thanks!

jgrossi commented Jan 3, 2017

@dmaciej It worked for me as well, same env, but I'm using php 5.6! Really thanks!

javian pushed a commit to javian/homebrew-php that referenced this issue Jan 4, 2017

Jan Viljanen
php{54-71}-mongodb: revision update
Update bottles for El Capitan to fix Homebrew#3737
_clock_gettime error at runtime

@javian javian referenced this issue Jan 4, 2017

Closed

php{54-71}-mongodb: revision update #3890

2 of 3 tasks complete

@javian javian closed this in a3f3c11 Jan 4, 2017

@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Jan 4, 2017

Member

@dmaciej @jgrossi I've regenereated the bottles so they should be built with the latest setup - can you confirm that the bottles now work without having to install from source ?

Member

javian commented Jan 4, 2017

@dmaciej @jgrossi I've regenereated the bottles so they should be built with the latest setup - can you confirm that the bottles now work without having to install from source ?

@javian javian reopened this Jan 7, 2017

@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Jan 7, 2017

Member

According to #3890 (comment) this has not been resolved.

Member

javian commented Jan 7, 2017

According to #3890 (comment) this has not been resolved.

@lenyapugachev

This comment has been minimized.

Show comment
Hide comment
@lenyapugachev

lenyapugachev Jan 9, 2017

@javian is there some workaround for now? Already a week of deploying to server for test, instead of local, wasting time :(

lenyapugachev commented Jan 9, 2017

@javian is there some workaround for now? Already a week of deploying to server for test, instead of local, wasting time :(

@jgrossi

This comment has been minimized.

Show comment
Hide comment
@jgrossi

jgrossi Jan 9, 2017

@javian thanks for the effort, but it's not working yet, just with --build-from-source flag :-(

jgrossi commented Jan 9, 2017

@javian thanks for the effort, but it's not working yet, just with --build-from-source flag :-(

@lenyapugachev

This comment has been minimized.

Show comment
Hide comment
@lenyapugachev

lenyapugachev Jan 9, 2017

@jgrossi strange that for me it's still fails even if I'm unlink, uninstall and then brew install --build-from-source php56-mongodb

lenyapugachev commented Jan 9, 2017

@jgrossi strange that for me it's still fails even if I'm unlink, uninstall and then brew install --build-from-source php56-mongodb

@jgrossi

This comment has been minimized.

Show comment
Hide comment
@jgrossi

jgrossi Jan 9, 2017

@lenyapugachev maybe you need to install some dependency by hand

jgrossi commented Jan 9, 2017

@lenyapugachev maybe you need to install some dependency by hand

@lenyapugachev

This comment has been minimized.

Show comment
Hide comment
@lenyapugachev

lenyapugachev Jan 10, 2017

@jgrossi what dependencies you mean?

lenyapugachev commented Jan 10, 2017

@jgrossi what dependencies you mean?

@jgrossi

This comment has been minimized.

Show comment
Hide comment
@jgrossi

jgrossi Jan 10, 2017

@lenyapugachev I had to install cmake

jgrossi commented Jan 10, 2017

@lenyapugachev I had to install cmake

@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Jan 10, 2017

Member

@jgrossi that's strange if that works since the module does not seem to require cmake.

Member

javian commented Jan 10, 2017

@jgrossi that's strange if that works since the module does not seem to require cmake.

@jmikola

This comment has been minimized.

Show comment
Hide comment
@jmikola

jmikola Jan 23, 2017

Perhaps the patch for ffmpeg's forumla can be adapted to the phpXX-mongodb formulae:

   def install
+    # Fixes "dyld: lazy symbol binding failed: Symbol not found: _clock_gettime"
+    if MacOS.version == "10.11" && MacOS::Xcode.installed? && MacOS::Xcode.version >= "8.0"
+      inreplace %w[src/libbson/src/bson/bson-clock.c], "HAVE_CLOCK_GETTIME", "UNDEFINED_GIBBERISH"

     Dir.chdir "mongodb-#{version}" unless build.head?

jmikola commented Jan 23, 2017

Perhaps the patch for ffmpeg's forumla can be adapted to the phpXX-mongodb formulae:

   def install
+    # Fixes "dyld: lazy symbol binding failed: Symbol not found: _clock_gettime"
+    if MacOS.version == "10.11" && MacOS::Xcode.installed? && MacOS::Xcode.version >= "8.0"
+      inreplace %w[src/libbson/src/bson/bson-clock.c], "HAVE_CLOCK_GETTIME", "UNDEFINED_GIBBERISH"

     Dir.chdir "mongodb-#{version}" unless build.head?
@lenyapugachev

This comment has been minimized.

Show comment
Hide comment
@lenyapugachev

lenyapugachev commented Feb 4, 2017

@jmikola @javian @jgrossi any updates on these?

@adocwang

This comment has been minimized.

Show comment
Hide comment
@adocwang

adocwang Feb 15, 2017

@lenyapugachev @jmikola jmikola's solution works fine for me. I have meet the error under php71-mongodb, EI Capitan.and I think this solution may be the final solution.
The issue may be explained clearly here
i just telling the detail steps of jmikola's solution.

  • make sure you have the latest version of xcode-select,mine is 2343 xcode-select -v,if not update then restart your mac

  • brew edit {formula} #formula likes php71-mongodb

  • edit it,add lines after “install”, may like this
    def install
    Dir.chdir "mongodb-#{version}" unless build.head?
    if MacOS.version == "10.11" && MacOS::Xcode.installed? && MacOS::Xcode.version >= "8.0"
    inreplace %w[src/libbson/src/bson/bson-clock.c], "HAVE_CLOCK_GETTIME", "UNDEFINED_GIBBERISH"`
    end

  • reinstall php71-mongodb from source brew reinstall -s php71-mongodb

the key of the solution is to replace HAVE_CLOCK_GETTIME to UNDEFINED_GIBBERISH in bson-clock.c
have fun!

adocwang commented Feb 15, 2017

@lenyapugachev @jmikola jmikola's solution works fine for me. I have meet the error under php71-mongodb, EI Capitan.and I think this solution may be the final solution.
The issue may be explained clearly here
i just telling the detail steps of jmikola's solution.

  • make sure you have the latest version of xcode-select,mine is 2343 xcode-select -v,if not update then restart your mac

  • brew edit {formula} #formula likes php71-mongodb

  • edit it,add lines after “install”, may like this
    def install
    Dir.chdir "mongodb-#{version}" unless build.head?
    if MacOS.version == "10.11" && MacOS::Xcode.installed? && MacOS::Xcode.version >= "8.0"
    inreplace %w[src/libbson/src/bson/bson-clock.c], "HAVE_CLOCK_GETTIME", "UNDEFINED_GIBBERISH"`
    end

  • reinstall php71-mongodb from source brew reinstall -s php71-mongodb

the key of the solution is to replace HAVE_CLOCK_GETTIME to UNDEFINED_GIBBERISH in bson-clock.c
have fun!

@lenyapugachev

This comment has been minimized.

Show comment
Hide comment
@lenyapugachev

lenyapugachev commented Feb 17, 2017

@adocwang Hooray! 👌

@islamz

This comment has been minimized.

Show comment
Hide comment
@islamz

islamz commented Mar 5, 2017

@adocwang you the best

@javian

This comment has been minimized.

Show comment
Hide comment
@javian

javian Mar 26, 2017

Member

Feel free to submit a PR that does this.

Member

javian commented Mar 26, 2017

Feel free to submit a PR that does this.

@MikeMcQuaid

This comment has been minimized.

Show comment
Hide comment
@MikeMcQuaid

MikeMcQuaid Mar 28, 2018

Member

As announced on the 19th of January this tap will be archived by 31st March 2018. Various PHP formulae have been migrated to Homebrew/homebrew-core.

Member

MikeMcQuaid commented Mar 28, 2018

As announced on the 19th of January this tap will be archived by 31st March 2018. Various PHP formulae have been migrated to Homebrew/homebrew-core.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.