Jump to content

Manual talk:How to debug

About this board

Previous discussion was archived at Manual talk:How to debug/Archive 1 on 2019-01-23.

Unknown Internal Error

4
Thepainking (talkcontribs)

Hello. Hope all are well.

My wiki sometimes gets an internal error I am not aware of why or what it is. Can someone please explain to me what this means and why this is happening? The following message comes up:

[YoO_Wl0PMPGEqgm7K-uljwAAABk] 2022-05-17 15:29:30: Fatal exception of type MWException

Any assistance would be greatly appreciated to resolve this issue.

TIA

BDavis (WMF) (talkcontribs)

You will need to setup logging (or find existing log files from your current configuration) in order to find out more about that error.

Thepainking (talkcontribs)

These are the details i received:

Parse error: syntax error, unexpected end of file in /nfs/c10/h05/mnt/229444/domains/encyclopediaoftouchbodysenseandpain.com/html/LocalSettings.php on line 196

initially it said line 206 which was blank so deleted all the blank lines upto 196 and now it says this. Can someone please explain this to me and how i can fix it?

TIA

BDavis (WMF) (talkcontribs)

This error message indicates that there is a syntax error in your LocalSettings.php file. Web searches can help you find advice on how to figure out exactly what is wrong with the syntax. An example of this kind of advice that I found by searching for "php syntax error" is https://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them. Most commonly I would start by looking for mismatched quotes, missing quotes, and missing semicolons introduced by various bits of configuration you may have copied into your LocalSettings.php file.

Reply to "Unknown Internal Error"

wfDebugLog works on web page but not in phpunit

2
Qdinar (talkcontribs)

when i put wfDebugLog in a php file it works when i open a local mediawiki page, but not when i run phpunit test.

Qdinar (talkcontribs)

it is permission problem. phpunit runs by user, local page runs by www-data. when i tried log file in user home folder, it works.

Reply to "wfDebugLog works on web page but not in phpunit"

Please explain wfDebugLog in more detail

2
Otheus (talkcontribs)

1. Please explain how wfDebugLog actually works. What happens if no debug-group array is defined? What happens if it is defined but the particular group is not? For instance, if wfDebugLog("test","string") and "test" is not an element in in the groups variable, what happens?

2. How can we overwrite the string-emit function so that the debug lines contain useful information, such as session-id or sever-unique-id or process-id, and date-time stamp?

3. In the "LegacyLogger" factory definition, there is reference to PSR-3 logging, and that wfDebug is considered 'legacy'. Where is this non-legacy logging feature documented?

BDavis (WMF) (talkcontribs)
Reply to "Please explain wfDebugLog in more detail"
Berot3 (talkcontribs)

I have question regarding the php.ini-conf "session.save_path".

Is this in MediaWiki 1.35 used for anything else than the setup (mw-config)?

At least on windows it writes to the windows-temp folder if this config is not set.

If this is only for setup than I'm fine with it. Since user-login are not stored there since some versions, there is nothing left, right?

Reply to "session.save_path?"
Otheus (talkcontribs)

> xdebug_on; php5 /vagrant/mediawiki/tests/phpunit/phpunit.php --wiki=wiki /vagrant/mediawiki/extensions/Extension/tests/phpunit/SomeTest.php; xdebug_off

Yeah, that command doesn't exist. And php5? Really?

BDavis (WMF) (talkcontribs)

xdebug_on and xdebug_off are shell functions included in MediaWiki-Vagrant. They set and clear the environment variables XDEBUG_CONFIG and PHP_IDE_CONFIG. The docs could make this more clear.

The explicit use of php5 is also a dated reference to MediaWiki-Vagrant configuration. Modern MediaWiki-Vagrant usage should be just php or possibly php7.2. The legacy php5 was once needed to select a Zend-based PHP runtime rather than an HHVM runtime.

There are no older topics