Code Monkey home page Code Monkey logo

Comments (4)

lcharette avatar lcharette commented on July 28, 2024 1

IDE might be out of scope of UF, unlike our Docker/Lando/Homestead integration. Maybe a link to an external guide could be enough.

This would be for XDebug v3, which thankfully is easier to get working.

Meh, depend on the OS... Looking at you Big Sur...

from learn.

lcharette avatar lcharette commented on July 28, 2024

I should have kept the setup steps on Homestead. I could add Homestead setup once you’ve done the Docker one.

from learn.

lcharette avatar lcharette commented on July 28, 2024

Also need to note debug is required to generate coverage report locally...

Here's some notes I have laying around:


Homestead

https://edcs.me/blog/setting-up-xdebug-with-phpstorm-and-laravel-homestead/

    sudo su
    apt-get install php-xdebug
    nano /etc/php/7.2/fpm/conf.d/20-xdebug.ini
    zend_extension=xdebug.so
    xdebug.remote_enable=1
    xdebug.remote_connect_back = 1
    xdebug.remote_port = 9000
    xdebug.max_nesting_level = 250
    nano /etc/php/7.2/cli/conf.d/20-xdebug.ini
    service php7.2-fpm restart
    php -i | grep "xdebug support"

MacOS Mojave

    vendor/bin/phpunit --coverage-html _meta/coverage
    Error:         No code coverage driver is available

https://xdebug.org/docs/install

Install Pear and Pecl :

https://jason.pureconcepts.net/2012/10/install-pear-pecl-mac-os-x/

    curl -O https://pear.php.net/go-pear.phar
    sudo php -d detect_unicode=0 go-pear.phar

You should now be at a prompt to configure PEAR.

  1. Type 1 and press return.
  2. Enter: /usr/local/pear
  3. Type 4 and press return.
  4. Enter: /usr/local/bin
  5. Press return
    pear version

Autoconf :

    curl http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz > autoconf.tar.gz
    tar -xvzf autoconf.tar.gz
    cd autoconf-2.69
    ./configure
    sudo make && sudo make install
    export PHP_AUTOCONF=/usr/local/bin/autoconf

Install Headers Files :

    sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

Xdebug :

    sudo pecl install xdebug
    
    sudo mkdir -p /usr/local/php/extensions
    
    sudo cp /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so /usr/local/php/extensions
    
    sudo nano /etc/php.ini
    [xdebug]
    zend_extension=/usr/local/php/extensions/xdebug.so
    xdebug.remote_enable=on
    xdebug.remote_log="/var/log/xdebug.log"
    xdebug.remote_host=localhost
    xdebug.remote_handler=dbgp
    xdebug.remote_port=9000
    sudo apachectl restart
    php -i | grep "xdebug support"

Atom XDebug

https://medium.com/vehikl-news/remote-php-debugging-with-xdebug-atom-and-homestead-a6db258cfa6a

Safari : https://itunes.apple.com/ca/app/safari-xdebug-toggle/id1437227804?l=fr&mt=12
Chrome : https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en

Vagrant box:

    ports:
    - send: 9999
      to: 9000
    vagrant reload --provision
    vagrant ssh
    sudo nano /etc/php/7.2/fpm/conf.d/20-xdebug.ini

Make sure it contains :

    xdebug.remote_enable = 1
    xdebug.remote_connect_back = 1

If any changes :

    sudo service php7.2-fpm restart

In Atom, install php-debug

from learn.

Silic0nS0ldier avatar Silic0nS0ldier commented on July 28, 2024

Built in lando support coming in 4.5 simplifies things somewhat, but integrating IDEs with XDebug remains a pain point. I'm of the mind we should try and get some guides together for common IDEs (VS Code, PHPStorm) and OS (since they impact how things are setup in some circumstances).

This would be for XDebug v3, which thankfully is easier to get working.

from learn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.