Project:DebuggingPHPinMediawiki: Difference between revisions
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
https://www.mediawiki.org/wiki/Manual:How_to_debug | https://www.mediawiki.org/wiki/Manual:How_to_debug | ||
=== XDEBUG in Docker: === | |||
XDEBUG in Docker: | |||
This is about to setup debugging with breakpoints etc. with xdebug. | This is about to setup debugging with breakpoints etc. with xdebug. | ||
Starting from portal-compose, adapt your docker-compose.override.yml as suggested in the Readme.md | Starting from portal-compose, adapt your docker-compose.override.yml as suggested in the Readme.md | ||
==== PHPStorm setup ==== | |||
Setting up PHPStorm IDE with XDEBUG and Containers. | |||
There are two major steps involved in set up: | |||
* Setting up a debugging configuration with localhost and port 9000 | |||
* Setting up directory mapping, this maps local code-directories to wikibase container, so they can be used as sourcecode for debugging. | |||
* Both steps are can be seen in many web-documentations, [https://hackernoon.com/how-to-debug-php-container-with-xdebug-and-phpstorm-1b2k3yjo example is this] from step 4 (only port has to be changed from 80 to 9000) | |||
To start debugging, call any page of the wiki while running the debugging configuration. Then, a dialogue by IDE appears which has to be accepted. | |||
If the directories are mapped correctly you can now set breakpoints in the code and the ide stops at these. | |||
For troubleshooting debugging issues, going through these steps can be very helpful: | |||
* https://medium.com/advanced-xdebug-connection-issues-troubleshooting/debug-your-xdebug-advanced-troubleshooting-part-1-network-issues-25da412d0a11 | * https://medium.com/advanced-xdebug-connection-issues-troubleshooting/debug-your-xdebug-advanced-troubleshooting-part-1-network-issues-25da412d0a11 | ||
* https://medium.com/advanced-xdebug-connection-issues-troubleshooting/debug-your-xdebug-advanced-troubleshooting-part-2-xdebug-settings-ef91d05dc526 | * https://medium.com/advanced-xdebug-connection-issues-troubleshooting/debug-your-xdebug-advanced-troubleshooting-part-2-xdebug-settings-ef91d05dc526 |
Revision as of 15:43, 29 March 2022
Most of the code in MediaWiki and its extensions is written in PHP.
For an overview, there are several possibilities including logs and debugging output on MediaWiki pages listed here: https://www.mediawiki.org/wiki/Manual:How_to_debug
XDEBUG in Docker:
This is about to setup debugging with breakpoints etc. with xdebug.
Starting from portal-compose, adapt your docker-compose.override.yml as suggested in the Readme.md
PHPStorm setup
Setting up PHPStorm IDE with XDEBUG and Containers.
There are two major steps involved in set up:
- Setting up a debugging configuration with localhost and port 9000
- Setting up directory mapping, this maps local code-directories to wikibase container, so they can be used as sourcecode for debugging.
- Both steps are can be seen in many web-documentations, example is this from step 4 (only port has to be changed from 80 to 9000)
To start debugging, call any page of the wiki while running the debugging configuration. Then, a dialogue by IDE appears which has to be accepted.
If the directories are mapped correctly you can now set breakpoints in the code and the ide stops at these.
For troubleshooting debugging issues, going through these steps can be very helpful: