Pure PHP/HTML implementation


Hi all, 

nice to meet you!

I have the task to integrate H5P in our own LMS. The platform is PHP/HTML/MYSQL based, so the first question I would like to ask is:

someone has ported H5P integration to a pure PHP/HTML project? All other forum topics suggest me that no one has done it.. this is sad because I think that could be a better starting point for anyone..

I'm trying to port the code from the drupal integration (because the wp one has not the newest interface implemented), but it is really hard... all this CMS and your related plugin/module use a lot of the CMS function, so the porting to plain PHP is very hard..

Another difficult is that the documentation and the comments in the code does not explain:

- what are the required implementations and to achieve what specific goal

- what does each method of the interfaces must do in detail

- what are the steps for an easy implementation: e.g. create in DB this tables, the table x must contain this, insert in that moment and selected in this other moment, etc..

This seems a very frustrating job honestly, and I don't know if it is really a possible task to achieve. :(

I hope you can give me some guidelines.. 

Thanks in advance,


serettig's picture

I think it's possible to do this, but very hard work, indeed. The H5P PHP core is very confusing and it doesn't help that it's spread out across two repositories. Maybe you can also look at different implementations than the one for Drupal. There are also some contributed by the community, like the one for ILIAS. I'd recommend not just looking at the Drupal module, put also at h5p-php-library and h5p-editor-php-library.

Depending on your skills and available tech stack, you could also use the h5p-nodejs-library to create a H5P microservice that runs fully independently of your LMS (e.g. in a Docker container). If you only use a HTTP REST API to do the H5P stuff, the fact that your LMS uses PHP doesn't matter. You still don't get all the features of the official PHP version and we don't have a SQL storage class at the moment (would not be terribly difficult to add).

Hi serettig, 

thanks for the reply! Can I ask why are you suggesting me to look at the ILIAS implementation? What are the advantages?

Where can I found these other implementation? They have implemented last version of the H5P interfaces (I'm looking to the Drupal one for this reason).

However,  I don't know of it's acceptable for my task, but where I can find the nodejs implementation? Is up to date? I've found a nodejs implementation but all the documentation does not exists anymore, so I assumed it was an old implementation and has the same documentation lack so I've dropped the idea away..

Thanks in advance,


serettig's picture

Hi Cristina,

It's just a hunch, but the ILIAS implementation was written by other poor souls who had to figure out how the H5P core works. Possibly, it's easier to imitate, as the Drupal, Moodle and WordPress implementations were written by Joubel who simply know the H5P core very well. Furthermore, the "old" parts of H5P suffer from some serious technical debt - not to say that they are chaotic and don't follow common software engineering practices. I quick glance at the ILIAS implementation shows that it is structured much better.

You can find the ILIAS implementation at https://github.com/studer-raimann/H5P and the NodeJS re-implementation of the core at https://github.com/lumieducation/h5p-nodejs-library. I wrote most of the NodeJS version myself. It is maintained and also up to date, but there are a few features of the PHP version we haven't come round to implementing yet. I'm not sure which version you found, but possibly this is Joubel's own simple NodeJS verison which is seriously outdated and certainly far from production-ready. You can find out documentation at https://docs.lumi.education.


Thanks for the tips, Sebastian!

Finger crossed :)

icc's picture

In case you didn't see this: Platform Integration Development

Sadly, not fully up-to-date or complete.