A skill for AI coding assistants (Claude, OpenCode, etc.) to install and configure Moodle LMS on Laravel Herd.
Moodle 5.x introduced a new directory structure with a public/ folder, which causes issues with Laravel Herd/Valet:
- CSS/JS files return HTML instead of actual content
ERR_CONTENT_DECODING_FAILEDerrors- Slash arguments not working with Nginx
- Database driver confusion (mysqli vs mariadb)
This skill documents all the solutions discovered through trial and error.
| Issue | Solution |
|---|---|
| CSS/JS not loading | $CFG->slasharguments = false; |
| Gzip decode errors | Add gzip off; to Nginx config |
| dirroot errors | Point to /public folder |
| DB connection fails | Use mariadb driver, port 3307 |
Copy the SKILL.md file to your skills directory:
# OpenCode
cp -r moodle-herd-installer ~/.opencode/skills/
# Claude Code
cp -r moodle-herd-installer ~/.claude/skills/Just reference the SKILL.md file when setting up Moodle on Herd.
moodle-herd-installer/
├── SKILL.md # Main skill instructions
├── assets/
│ ├── config.template.php # Ready-to-use config template
│ └── nginx-gzip-off.conf # Nginx fix snippet
└── README.md # This file
- Clone Moodle 5.x
- Link from
public/folder:cd moodle/public && herd link moodle - Copy
assets/config.template.phptomoodle/config.php - Replace placeholders in config
- Run:
php admin/cli/install_database.php --agree-license - Access: https://moodle.test
- Moodle 5.1.1 (MOODLE_501_STABLE)
- Laravel Herd (Windows)
- MariaDB 10.11
- PHP 8.4
Found another issue? PRs welcome!
MIT