🧩 Installing Semantic MediaWiki in Docker
Add Semantic MediaWiki to your Docker-based MediaWiki setup, handle version mismatches, and keep everything running smoothly.

- Enable Semantic MediaWiki
In your LocalSettings.php, add:
wfLoadExtension( 'SemanticMediaWiki' );
enableSemantics( 'your_wiki_name' );
Run the update script:
php maintenance/update.php
Install Semantic MediaWiki via Composer:
composer require mediawiki/semantic-media-wiki:"^5.0.2"
- Update Docker for latest PHP
After enabling Semantic MediaWiki, update Docker to use the latest PHP (see official Docker images for reference).
Then restart services:
docker compose down
docker compose pull
docker compose up -d --build
- Fix common errors
- Error: Class "SMWDIProperty" not found
Search for references:
grep -R "SMWDIProperty" .
If found → replace with:
\SMW\DIProperty
If not found → update PageForms branch:
cd /var/www/html/w/extensions/PageForms
git pull origin REL1_41
- Error: SMWRequestOptions mismatch
sed -i 's/new SMWRequestOptions()/new \\SMW\\RequestOptions()/g' \
extensions/PageForms/includes/PF_ValuesUtils.php \
extensions/PageForms/specials/PF_CreateTemplate.php
sed -i 's/@param SMWRequestOptions/@param \\SMW\\RequestOptions/g' \
extensions/PageForms/includes/PF_ValuesUtils.php
✅ Your Docker-based MediaWiki now has Semantic MediaWiki configured and ready.