Can't install xdebug on Mac with Homebrew

前端 未结 11 761
小蘑菇
小蘑菇 2020-12-24 01:31

I\'m kind of new to using Homebrew, but I love it. It\'s so easy. I\'m trying install Xdebug. Some of the posts on the web say to do this:

brew install xd         


        
相关标签:
11条回答
  • 2020-12-24 01:34

    macOS 10.14 Mojave, Homebrew, PHP 7.3, April 2020

    The description given in the following article was the only thing I could get to work on macOS 10.14 Mojave with Homebrew to install PHP 7.3 with working xdebug:

    brew list | grep php | awk '{ print "brew uninstall --force "$1}' | bash        # Remove any old version of php.
    rm -rf /usr/local/Cellar/php                                                    # To be sure, manually remove the php cellar folder.
    brew untap homebrew/php                                                         # Then clean any php tap (extra repo).
    brew cleanup                                                                    # Cleanup and Update your brew.
    brew update
    brew install php                                                                # Install the latest version of php.
    pecl uninstall xdebug                                                           # Clean up old xdebug.
    pecl install xdebug-beta                                                        # Install the latest version of xdebug-beta (The xdebug is not compatible with 7.3 so you need to use the xdebug-beta).
    php -v                                                                          # Should now say "with Xdebug v2.9.4, Copyright (c) 2002-2020, by Derick Rethans"
    
    0 讨论(0)
  • 2020-12-24 01:36

    Add this repository: https://github.com/josegonzalez/homebrew-php#readme

    Then use brew install php54-xdebug for PHP 5.4

    Or brew install php53-xdebug for PHP 5.3

    Or brew install php55-xdebug for PHP 5.5

    0 讨论(0)
  • 2020-12-24 01:36

    This is my solution! Try it! ;)

    1 Install developer tools:

    xcode-select --install
    

    2 Instal Autoconf. This is a tool for producing shell scripts that automatically configure software

    brew install autoconf
    

    3 If you use PHP >5.6

    sudo pecl install xdebug
    

    Have fun ;)

    0 讨论(0)
  • 2020-12-24 01:37

    If you get this error after adding the tap and installing:

    $ brew install "josegonzalez/php/php55"
    ==> Installing php55 from josegonzalez/php
    Error: Formulae found in multiple taps: 
     * homebrew/php/php53
     * josegonzalez/php/php53
    
    Please use the fully-qualified name e.g. homebrew/php/php53 to refer the formula.
    

    it is because josegonzalez/php has been moved to homebrew-php/php recently, so you will face the previous error.

    The idea is pretty simple, remove the old deprecated repo josegonzalez/php

    brew untap josegonzalez/php
    brew tap --repair
    brew update
    

    See the source of this solution to fix any other related bugs.

    0 讨论(0)
  • 2020-12-24 01:42

    Forget about homebrew for a moment. I have tried doing with it and it is not a that good idea stability-wise. Instead stick to the default installation guide:

    Installing XDebug on Mac OSX

    1. Go to http://xdebug.org/wizard.php and paste your phpinfo() content there.
    2. Download xdebug-2.2.5.tgz (http://xdebug.org/files/xdebug-2.2.5.tgz)
    3. Unpack the downloaded file with:

      tar -xvzf xdebug-2.2.5.tgz

    4. Run:

      cd xdebug-2.2.5

    5. Run phpize (install it via homebrew if you don't have it already)

      phpize

    6. As part of its output it should show (If it does not, you are using the wrong phpize):

      Configuring for: ...
      Zend Module Api No: 20100525
      Zend Extension Api No: 220100525

    7. Run:

      ./configure

    8. Run:

      make

    9. Run:

      cp modules/xdebug.so /usr/lib/php/extensions/no-debug-non-zts-20100525

    10. Edit /etc/php.ini and add the line:

      zend_extension = /usr/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so

    11. Restart the web server by typing in the terminal:

      sudo apachectl restart

    0 讨论(0)
  • 2020-12-24 01:42

    It helped me to solve zend version and xdebug Xdebug requires Zend Engine API version 320160303. The Zend Engine API version 320180731 which is installed, is newer.

    https://xdebug.org/wizard.php

    0 讨论(0)
提交回复
热议问题