![]() ![]() If the virtual machine is running, execute the command: `vagrant provision`. If you had already created the VM, you can still make changes to the `config.yml` file and then reprovision. Start the virtual machine by executing `vagrant up`. Keep the terminal open are going to execute various commands from there. Then, open a terminal and change directory to where the DrupalVM files are located. These last two settings are very important for being able to debug Drush commands. Finally, set `php_xdebug_default_enable` to `1` and `php_xdebug_cli_disable` to `no`. Drupal Console is not necessary for getting XDebug to work, but it offers many code introspection tools that are very useful for Drupal debugging in general. In the `installed_extras` section, uncomment `xdebug` and `drupalconsole`. The plugin will make sure that an available IP is assigned to the VM. If you are unsure, you can set the value to `0.0.0.0` and install the `vagrant-auto_network` plugin. Set `vagrant_ip` to an IP that has not been taken by another virtual machine. The `vagrant_hostname` is the URL you will enter in your browser’s address bar to access the Drupal installation. # Make sure the following three get installed by uncommenting them. # All the other extra packages can remain enabled. ![]() # Otherwise, use an IP address that has not been used by any other virtual machine. # For dynamic IP assignment the 'vagrant-auto_network' plugin is required. In this file make the following changes: # config.yml file ![]() The latter will be used by DrupalVM to configure the virtual machine (VM). Before creating the virtual machine, make a copy of `` into a new file named `config.yml`. If you downloaded a compressed file, expand it to have access to the configuration files. Getting DrupalVMįirst get a copy of DrupalVM by cloning the repository or downloading a ZIP or TAR.GZ file from the available releases. If you need help with those, refer to the DrupalVM’s installation guide. For this article, it is assumed that VirtualBox, Vagrant, and Ansible are already installed. Refer the the official DrupalVM documentation for detailed installation and configuration instructions. Screenshots and referenced on-screen text might be differ in new versions of the different tools. Important: User interfaces tend to change. And then, via the user interface using a browser. First, via the command line using Drush commands. In today’s article we are going to learn how to configure XDebug inside DrupalVM to connect to PHPStorm. Using a proper debugger is definitely the best way to debug Drupal be it migrations or other substems. Removing remote_host, adding localhost, etc.In recent articles, we have presented some recommendations and tools to debug Drupal migrations. Xdebug settings in config.yml (Set to how it comes by default, W: Creating socket for '.xx:9000', poll success, but error: Operation now in progress (29).Īny ideas on what I can try to get it to work? I: Connecting to configured address/port: .xx:9000. I: Connecting to configured address/port: 10.0.2.2:9000. Here is the Xdebug log: Log opened at 02:21:50 The script 'drush.phar' isn't associated with any text file type. ![]() One thing I noticed, is that if I set Phpstorm to break at first line in PHP Script, I noticed the following notice in debugger: Can't compute source position. With Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans With Zend OPcache v7.0.14-2+~xenial+1, Copyright (c) 1999-2016, by Zend Technologies Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies I also verified that if I debug on a page that I visit from a browser, it stops at breaks points so it is for sure working.Īlso, the PHP CLI does have Xdebug: PHP 7.0.14-2+~xenial+1 (cli) ( NTS ) The web server debug validation shows everything is good. # Use PHPSTORM for PHPStorm, sublime.xdebug for Sublime Text. Php_xdebug_remote_host: .xx // My Vagrant IP is really here. XDebug is disabled by default for better performance. Here is my Xdebug section of config.yml from Vagrant: # XDebug configuration. I am trying to debug a Drush migration script and I have some breakpoints put in but it never stops at the breakpoints. I had this working on another Drupal VM, but for some reason I can't get it to work anymore. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |