H5P Scheduled Task fails with HTTP 405 on hub-api.h5p.org/v1/sites (Moodle 5.2)
Hi everyone,
I am facing an issue with the H5P content types download task (core\task\h5p_get_content_types_task) on a fresh Moodle 5.2 installation hosted on Hostinger.
Whenever the scheduled task runs (either via cron or forced through CLI), it fails with an HTTP 405 Method Not Allowed error when trying to reach the H5P registration endpoint.
Here is the output when running the task via CLI:
[Execute scheduled task: Download available H5P content types from h5p.org (core\task\h5p_get_content_types_task)
... started 15:01:51. Current memory use 13.2 MB.
Debugging increased temporarily due to faildelay of 60
++ cURL request for "https://hub-api.h5p.org/v1/sites" failed, HTTP response code: HTTP/2 405
++
* line 1670 of /public/lib/filelib.php: call to debugging()
* line 380 of /public/h5p/classes/core.php: call to download_file_content()
* line 367 of /public/h5p/classes/core.php: call to core_h5p\core->register_site()
...
Scheduled task failed: Download available H5P content types from h5p.org (core\task\h5p_get_content_types_task),Invalid response value detected (No information could be obtained on the H5P content types available. H5P repository connection failure)]
Troubleshooting already done:
I suspected a hosting firewall block, so I ran a connectivity test via SSH directly from the server:
- curl -I https://h5p.org -> Returns HTTP/2 200 (Cloudflare)
- curl -I https://api.h5p.org -> Returns HTTP/1.1 404 (Nginx)
This confirms that outbound cURL requests are fully enabled on my server and it can talk to H5P servers. The 405 error seems to be specific to the POST/registration request that Moodle sends to https://hub-api.h5p.org/v1/sites.
Has anyone encountered this HTTP 405 error during site registration/content type updates recently? Is there any specific PHP or user-agent setting required to prevent the Hub API from rejecting Moodle's request?
Thank you in advance for your help!

otacke
Sat, 05/23/2026 - 22:26
Permalink
That error message may be a
That error message may be a lie. I remember getting it as well when exploring the new hub-api. h5p.org endpoints which do not behave the same way the old api.h5p.org endpoints do. What endpoint were you trying to call exactly?
otacke
Sat, 05/23/2026 - 22:31
Permalink
Oh, silly me. "sites". Will
Oh, silly me. "sites". Will check what it expects later.