2

I'd like to reinstall php70-xdebug package with debug symbols like:

$ brew reinstall php70-xdebug --with-debug
==> Reinstalling homebrew/php/php70-xdebug 
Warning: homebrew/php/php70-xdebug: this formula has no --with-debug option so it will be ignored!

however there is no --with-debug or other similar option to use (which does exist for php70).

How can I recompile this package with debug symbols via brew?

1

If the debugging option is not available for php70-xdebug (they aren't at the time of writing), you can add it by using one of the methods suggested below.

Manual steps

The debug options can be added manually by the following steps:

  1. Edit formula by this shell command:

    brew edit php70-xdebug
    
  2. Add the following lines:

    option "enable-debug", "Compile with debugging symbols"
    option "disable-debug", "Compile without debugging symbols (default)"
    
  3. Verify the existence of option by:

    brew options php70-xdebug
    
  4. Reinstall package by:

    brew reinstall php70-xdebug --build-from-source --enable-debug
    

Pulling the changes from fork

Pull the changes from pull request #4341 from GitHub by:

cd "$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-php"
git pull https://github.com/kenorb-contrib/homebrew-php.git task/php70-xdebug-debug-options
brew reinstall php70-xdebug --build-from-source --enable-debug

Related: Cannot load Xdebug, as PHP was built with API NTS debug.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .