PhpStorm debug with Laravel Homestead not working

后端 未结 1 1203
情深已故
情深已故 2020-12-10 00:44

I\'m trying to setup PhpStorm to debug correctly within a Vagrant Homestead environment. Xdebug is correctly installed and I\'m running PHP 7.1

After setting a break

相关标签:
1条回答
  • 2020-12-10 01:14

    Step 1

    Install PHPStorm 2017.X

    Install Xdebug helper for chrome

    Step 2

    Via ssh (choose a tool like putty, WinSCP, MobaXterm etc.) Install xdebug, in your case laravel gets Ubuntu 16.04 by default with Nginx so we need to follow these instructions The values I used are

    ; Enable xdebug extension module
    zend_extension=/usr/lib64/php/modules/xdebug.so
    xdebug.remote_enable=1
    xdebug.remote_handler=dbgp
    xdebug.remote_port=9000
    xdebug.remote_autostart=1
    xdebug.remote_connect_back=1
    xdebug.remote_host=10.0.2.2
    

    in /etc/php.d/xdebug.ini

    But note that I use my own vagrant installation (homestead is based on Vagrant) with CentOS and apache instead. Restart your virtual machine after config changes.

    vagrant / homestead halt
    

    and start again

    vagrant / homestead up
    

    Step 3

    Config Xdebug helper extension in chrome by right clicking the symbol > options and set your IDE key to PHPStorm in the dropdown menu.

    Configure PHPStorm, like a lot

    hint: Settings has the shortcut ctrl + alt + s

    Check the following settings. Don't forget to add both http and https in the Servers Setting and most important, don't read over the path mappings part.

    And last but not least click these buttons, the first button with the phone horn actually has reversed icons in my opinion: when debugging it should have the little green part, altough logically red would mean stop, now it means start.

    button 2 starts your url with a session var in the query string!

    P.s. from your question: I think you need to go 1 level up root of laravel instead of public folders

    edit: I just installed homestead at home and it comes with xdebug installed:

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