A few weeks I updated to Mac OSX 10.9. A few days later I wanted to install PHP 5.5 and when I tried using homebrew which I already had installed I got the following error:
configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no
I spent numerous hours of installing and reinstalling homebrew, xcode, command line tools and nothing worked until I came across a comment about a file not updating with xcode and this is how I ended up fixing the issue.
Please note that this may not work for you if your try but I wanted to leave it known that this way my solution and hopefully save someone hours and hours of frustration,
1. Uninstall Homebrew
Firstly I uninstalled Homebrew. I followed the comment here on super user.
cd `brew --prefix` rm -rf Cellar brew prune rm `git ls-files` rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions rm -rf .git rm -rf ~/Library/Caches/Homebrew
2. Update the install_name_tool file
After weeks of searching I found this comment on github which stated that for some reason when you update xcode it was not updating the install_name_tool file which was causing an error with the compiler.
This file can be found under usr/bin/install_name_tool. It was recommended to try a reinstall of Xcode or then try a reinstall of OSX. Now I didn’t want to go and reinstall OSX 10.9 so I contacted my colleague Eoghan O Brien for his install_name_tool as he had also updated to 10.9 with no problems with homebrew.
I then replaced the install_name_tool file under /usr/bin. I have zipped up this file which you can download and try at your own risk here.
3. Reinstall Homebrew
I then reinstalled homebrew with the following steps from the wiki:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)" brew doctor brew update brew install php55
After weeks of frustration it was great to have a PHP install via Homebrew again as it was really difficult having to install manually Xdebug and other libraries. I hope this will help someone who ran into the same difficulties as I did with the update to OSX 10.9.