Mediawiki PHP Fatal error: Cannot redeclare wfProfileIn() Error and Solution

The PHP Fatal error: Cannot redeclare wfProfileIn() error in MediaWiki typically occurs when there is a conflict between multiple copies of the same function or class in your MediaWiki installation.

This error can be caused by a number of different issues, such as:

  • Multiple copies of the same extension installed in different directories
  • A corrupted MediaWiki installation
  • A caching issue, such as an opcode cache storing multiple copies of the same code

To resolve the error, try the following steps:

  1. Check for multiple copies of the same extension: Make sure that you don’t have multiple copies of the same extension installed in different directories, as this can cause a conflict. Uninstall or remove any duplicate extensions.
  2. Reinstall MediaWiki: If your MediaWiki installation is corrupted, you may need to reinstall MediaWiki from scratch. Be sure to backup your database and any important files before reinstalling.
  3. Clear opcode cache: If you are using an opcode cache (such as APC or XCache), try clearing the cache to see if that resolves the issue.
  4. Disable extensions: If you’re unable to resolve the issue, you can try disabling extensions one by one to determine which extension is causing the conflict. To do this, you can move the extension’s directory out of the extensions/ directory, or you can comment out the relevant line in the LocalSettings.php file.

If none of these steps resolve the issue, you may need to consult the MediaWiki documentation or seek help from the MediaWiki community for further assistance.

Leave a Comment