lasasgraph.blogg.se

Phpstorm debugging
Phpstorm debugging





  • Click on the highlighted edit icon that is visible on the right of the same row.
  • Edit the “Absolute path on the server” field for the highlighted row.
  • For example, click on: /Users/You/Sites//web.
  • In the “File/Directory” column, highlight the (path to your Drupal root) row that is listed under the “Project files” folder, by clicking on it. Set the path mapping for the Drupal in Lando website’s root directory:
  • (or whatever lando provided, if applicable).
  • (Change this to match the domain name of your Drupal in Lando website.).
  • Click on the “+” in the top left of the left pane.
  • PhpStorm > Preferences > Languages & Frameworks > PHP > Servers.
  • (or whatever PHP version your Drupal in Lando website uses).
  • Image Name: devwithlando/php:7.1-apache.
  • (or click on the “+” icon at the top left of the pane).
  • Click on the “…” icon to the right of the “CLI Interpreter” field.
  • (or whatever PHP version your Drupal in Lando website uses).
  • PhpStorm > Preferences > Languages & Frameworks > PHP.
  • If prompted by the Event log window, “Set Drupal-style formatting for this project”.Ĭonfigure your PhpStorm project: Setup the PHP Interpreter for the project:
  • PhpStorm > Preferences > Languages & Frameworks > PHP > Frameworks.
  • The above configurations can also be set at:
  • (or whatever Drupal version you are using).
  • Verify that “Set up PHP | Include paths” is checked.
  • Drupal installation path: (Select your drupal root directory).
  • Verify that “Enable Drupal integration” is checked.
  • Enable Drupal Support, which should display the “Enable Drupal Integration” configuration window below.
  • Enable the Symfony Plugin with auto configuration now.
  • In the Event log window, enable the suggested items by clicking on them: If it isn’t, click on “Event log” in the bottom-right of the screen.
  • For example, /Users/You/Sites//webĪfter the project finishes indexing, the Event log window should be visible.
  • Mark as Project Root a directory to create the project in:

    phpstorm debugging

    Source Files are in a local directory, no Web server is yet configured.Open PhpStorm and click on the following: lando rebuild -y Create a new PhpStorm Project for your Drupal in Lando website: Rebuild your Drupal in Lando website in order to apply the new settings. If you plan on spinning-up both of them on the same machine at the same time, though, change the value in “name:” and “PHP_IDE_CONFIG:” of at least one of them first. lando.yml files as written, just to test things out. In fact, you could use either of the above. scripts/run-tests.sh -php /usr/local/bin/php" lando.yml configured for PhpStorm would look like the following: name: your-drupalĬmd: "php. lando.yml configured for PhpStorm would look like the following: name: your-drupalĪ complete but basic Drupal 7. lando.yml files:Ī complete but basic Drupal 8. scripts/run-tests.sh -php /usr/local/bin/php" Examples of complete Drupal 8 and Drupal 7. lando.yml file, so Lando will recognize “lando phpunit” commands.Ĭhange “web” above to match the webroot directory of your Drupal 8 in Lando website.Ĭmd: "php. PHP_IDE_CONFIG: "serverName="Ĭhange “” above to match the domain name of your Drupal in Lando website.Īdd the following to the “tooling” key of the. lando.yml file, so that Lando will include a PHP_IDE_CONFIG for PhpStorm. conf:Īdd the following to the “services” key of the. lando.yml file, so that Lando will include your new php.ini. lando.yml file for your Drupal in Lando website:Īdd the following to the “config” key of the. Inside this config directory, create a php.ini file with the following: For example, on OSX this might be: ~/Sites//config/.In the root directory of your lando project, create a “config” directory. Prepare your Drupal in Lando for PhpStorm: Create a custom php.ini for your Drupal in Lando website:

    phpstorm debugging

    You should be reasonably familiar with the command line, as well as with the above software.NOTE: drush 9 is currently NOT supported in PhpStorm.because if you had just written your unit test before you wrote that snazzy method, like you were supposed to,…😉.Debug phpunit tests for Drupal in Lando.Debug drush commands for Drupal in Lando.Debug Drupal 8 (and 7) in Lando: a Docker-based development environment.Once you finish, you will be able to use PhpStorm to: Even a freshly-installed, blank Drupal website will do. The question I get asked most often when discussing my Lando development environment with other Drupal Web Developers is, “How do you setup Lando and PhpStorm to debug Drupal using Xdebug?” This blog post will help you do exactly that.īefore you start, you should have a Drupal website up-and-running in Lando.







    Phpstorm debugging