Jump to content

Topic on Project:Support desk

PHP Fatal error:  Cannot declare class ParserOutput

5
Loman87 (talkcontribs)

Hello, I am getting this fatal error on my wiki:

Product Version
MediaWiki 1.40.0
PHP 8.3.7 (apache2handler)
ICU 70.1
MariaDB 10.11.8-MariaDB-ubu2204
Lua 5.1.5
Pygments 2.11.2

The complete apache log is the following:

PHP Fatal error:  Cannot declare class ParserOutput, because the name is already in use in var/www/html/mediawiki/includes/parser/ParserOutput.php on line 45, referer: [some page and some action]

This error is almost always logged but only sometimes actually breaks something, e.g. some API, the Change content model script, or some other action called while editing.

Any ideas?

TheDJ (talkcontribs)

Did you recently update your install ? It sounds a bit like you took an install, copied new files of the new release, but did not remove files of the old release. As ParserOutput has moved directories, you would thus have two conflicting versions of it.

Loman87 (talkcontribs)

no, I didn't update, I have a new installation installed via a control panel on a VPS. I have just one ParserOutput.php file in includes/parser folder, that correspond to the one I find on the rel-1.40.0.

Bawolff (talkcontribs)

Does the error message have more than that? Please include full error message.

I agree with TheDj on most likely cause. Try installing using an official version.

Loman87 (talkcontribs)

you are right, something was wrong in the hosting provider installation; I reinstall 1.41.3 and everything works fine.

Thanks vey much!

Reply to "PHP Fatal error:  Cannot declare class ParserOutput"