Wordpress - H5P module will not upload.

I have seen such "will not upload" posts before, but this one is a bit strange I think.

After I had upgraded the wordpress and the H5P installation (manually) I tried to upload a new
H5P module. The error message is this:

  • A valid content folder is missing
  • A valid main h5p.json file is missing

All modules give the same error message. It looks like none will upload.

The strange thing is that this server also has a Drupal installation with H5P that works without a problem.
So it should not be eny php.ini problems ot something like that. (If not Wordpress works much different from Drupal.)

I also tried to open the h5p modules to see if the "content" folder and the "h5p.json" file was there, and everything looked OK.

I would guess this is a some kind of funny and strange Wordpress/H5P bug, but I write it down, as refference and if anyone should happen to know or to have a tip, or if I should solve it myself.

I did reboot the whole server, but this did not help at all.

I also tried to change theme from 2012 to 2015. Did not help.


Deleted the database and intalled WP and H5P from scratch. Still same error.

icc's picture

Which module are you trying to upload, and are you uploading to the libraries page or the add new page? 

Is this a windows or linux server?

Its a (virtual) Linux server. The upload problem seems to exist for all modules, small as well as big, and also for the library upload page. The rather strange thing is that the same server also has a Drupal installation also with H5P installed. It looks like this works without a problem. (So the php.ini should be ok ..?)

It looks for me like the packages actually is uploaded from my Windows 7 client and that they arrives at the Linux server, but somewhere at the Linux server, in some temp directory, or somewhere the upload is lost. Its not a big problem for me as I have the Drupal installation running, but it is a quite interesting and strange problem to look into.

I have not yet been using a packet sniffer or a trafic monitor to se what actually happens and I have also not yet looked into the Linux log files, but I will do it, and if I find anything "strange" og "unusual" I will post it here. 

I forgot one thing. Now there is no error message and it looks like the files upload like normal, but then right after it says "No H5P modules installed".

Yes, there is a couple of PHP and H5P related messages in the htmld error log.

For me it is not a big problem at all that I will have to run H5P under Drupal and not under Wordpress, but this is qute a standard Centos 6.0 server, and I think it should have been working. I would guess that this error might repeat on other installations as well. 

If you are interested to see what hapens when H5P fails with Wordpress, I could send you some extract of the log. (I dont understand the content completely myself, but I can see that it is something related to php and H5p.)

Problem solved - I believe.

This directory "wp-content/uploads/h5p/temp/" had to be created and I sat the "security" to 0777.

I guess that this is a H5P installation bug, but that it can be corrected "manually" like this. 

And yes, the temp directory now contains a couple of H5P files.

At least I hope the problem is solved now :-)

icc's picture

Hm, yes that is strange. That folder should be created automatically. It could be some security settings or something on the server preventing the directory from being created. We have some cases on improving error handling, I'll make sure this becomes a part of them. The user should receive a understandable error message if there's something wrong with the setup.

Thank you for pointing this out!

Yes, I agree. I did not actually understand the eorror log of the server completely, but reading this forum I found the info about "wp-content/uploads/h5p/temp/" and also from the beginning of the trobleshooting I bilived it was a "/temp directory problem".

I have seen a couple of posts in this forum over the theme "can not upload" and I allways thougt it generally was a php.ini problem, but this "case" makes me believe that it might be other problems to be awere of as well. Good and clear error messages would allways help a lot.

By the way "we" should have been posting the required or recomended php.ini setting somewhere. (If its not just "there" somwhere and I did not see or notice.)