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

$ brew reinstall php70-xdebug --with-debug
==&gt; 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?
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:


Edit formula by this shell command:

brew edit php70-xdebug

Add the following lines:

option "enable-debug", "Compile with debugging symbols"
option "disable-debug", "Compile without debugging symbols (default)"

Verify the existence of option by:

brew options php70-xdebug

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.