Manual:How to debug/with MediaWiki-Vagrant and PHPStorm
From Linux Web Expert
- Install an XDebug browser extension, such as XDebug helper (Chrome, Firefox).
- Start listening to XDebug connections in PHPStorm with the phone icon (see image in step 2 here)
- Switch on the XDebug browser extension
- In the PHPStorm configuration go to Languges & Frameworks > PHP > Servers
- Add a new server with name and host
dev.wiki.local.wmftest.net
, port8080
(or whatever you configured; can be checked withvagrant config --get http_port
) - Check "Use path mappings"
- Below that, in the "Absolute path on the server" column set
/vagrant
in the row that corresponds to your vagrant directory, and/var/www
to the row that corresponds to thesrv/docroot
subdirectory
- Add a new server with name and host
- You are ready to go; set some breakpoints (by clicking on the empty space on the border to the left of your code) and make a request (reload the page or make it send an AJAX request)
For command-line debugging, instead of steps 1 and 3 you can use the xdebug_on
command (and then xdebug_off
to disable).
For other IDEs, see MediaWiki-Vagrant/Advanced_usage#MediaWiki debugging using Xdebug and an IDE in your host.