Install & update content types
It is important that you keep your H5P content types up to date to make sure that you have all the latest features (and bugfixes).
Important notice: On April 12th 2017 the H5P Hub was released, which replaces the old way of installing content types. You must make sure you are using a plugin version including the HUB if you want to install and update content types. For the different plugins, this means:
Drupal: minimum version 1.28
WordPress: minimum version 1.8.0
Moodle: minimum version 1.1 (2017041200)
Below are the instructions on how to update and install new content types with the latest version of the H5P plugin.
Comments
derek
Tue, 01/13/2015 - 18:28
Permalink
Uploading in wordpress
Just ried to upload the libaries file and i get this message
derek
Tue, 01/13/2015 - 18:34
Permalink
Uploading
also tried uploading the board game, same response
falcon
Wed, 01/14/2015 - 08:29
Permalink
Tried an upload now on labs
derek
Wed, 01/14/2015 - 09:31
Permalink
I have, yesterday, setup my
I have, yesterday, setup my wordpress site so it is the latest version. I also added the H5p plug in following the instructions on http://h5p.org/node/591.
I don't know what else to check.
falcon
Wed, 01/14/2015 - 14:22
Permalink
Ok, I'll ask icc to answer
icc
Thu, 01/15/2015 - 14:38
Permalink
Can you check your web server
Can you check your web server's error_log for any error messages when uploading the h5p?
derek
Thu, 01/15/2015 - 15:30
Permalink
does this explain anything?
[Thu Jan 15 05:06:33 2015] [error] [client 66.249.78.9] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Thu Jan 15 05:06:33 2015] [error] [client 66.249.78.9] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Thu Jan 15 09:50:58 2015] [error] [client 66.249.78.128] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Thu Jan 15 09:50:58 2015] [error] [client 66.249.78.128] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
icc
Fri, 01/16/2015 - 09:38
Permalink
Debug
I don't think these error are related to H5P. There might be a redirect loop somewhere in Apache or your CMS.
There's an error extracting the package(.h5p). Unfortnuatly the H5P plugin isn't very good at telling the user what these errors really mean. It would be of great value to us if you could do some debugging:
Find the file named h5p.classes.php, open it in a text editor and go to line ~649. It should look like:
if ($zip->open($tmpPath) === true) {
Before the line you insert the following line:
var_dump($zip->open($tmpPath)); exit;
Now you should see a blank screen with a number on it when uploading the file. Could you post this number here?
If you wish you can look up the error code your self here: http://php.net/manual/en/ziparchive.open.php
It might be related to your files dir.
Remove the debug line when you are done :-)
derek
Fri, 01/16/2015 - 14:07
Permalink
ok, got it int(11)
ok, got it
int(11)
icc
Fri, 01/16/2015 - 14:37
Permalink
Great, thank you! It seems
Great, thank you! It seems like this might be an issue with your php version, ref this post.
Could you try adding ZipArchive::CHECKCONS to the line, like this:
var_dump($zip->open($tmpPath, ZipArchive::CHECKCONS)); exit;
And check if you're getting the same error?
derek
Fri, 01/16/2015 - 15:56
Permalink
Yep, I get the same error
what do I do now?
icc
Fri, 01/16/2015 - 16:31
Permalink
Please try to print the file
Please try to print the file path and check if it exists:
var_dump($tmpPath); var_dump(file_exists($tmpPath)); exit;
What does it say?
derek
Fri, 01/16/2015 - 16:55
Permalink
it says only int(11), if I
it says only int(11), if I have understood you right.
I try to upload the file in the plugin library and just get the int(11) message
icc
Mon, 01/19/2015 - 11:34
Permalink
Try putting the line i
Try putting the line i specified in the last post above the following line:
if ($zip->open($tmpPath) === true) {
You should have no other changes to the lines.
The line will not return int(...) when you upload, if you've done it correctly you should see the path to the file you've uploaded.
derek
Mon, 01/19/2015 - 20:10
Permalink
Ok I now get this report
string(18) "/tmp/libraries.h5p" bool(false)
icc
Tue, 01/20/2015 - 09:30
Permalink
That is strange. It might be
That is strange. It might be that PHP's temporary directory isn't writable by PHP. You could check this by adding:
print (is_writable(sys_get_temp_dir()) ? 'Good, tmp directory is writable!' : 'Not good, PHP cannot write to ' . sys_get_temp_dir()); exit;
before line 241 in h5p/admin/class-h5p-plugin-admin.php:
rename($_FILES['h5p_file']['tmp_name'], $interface->getUploadedH5pPath());
and then uploading again.
You can safely remove the previous debug lines.
If this is the case I will add a more understandable error message to the plugin :-) Thank you for contributing!
derek
Tue, 01/20/2015 - 16:37
Permalink
line 241 ($_FILES['h5p_file'.......
I have done a serch for this string and it does not exist
from my line 241 is the following:
/**
* Update old content.
*
* @param array $content
* An associative array containing:
* - id: The content id
derek
Tue, 01/20/2015 - 17:25
Permalink
OK so I wrote the piece of
OK so I wrote the piece of code----- rename($_FILES['h5p_file']['tmp_name'], $interface->getUploadedH5pPath());----
went to the plug-in
libaries
and just got a blank screen, no upload options
derek
Tue, 01/20/2015 - 17:31
Permalink
I also put in the first part
I also put in the first part of the code----print (is_writable(sys_get_temp--------------
message return was
Not good, PHP cannot write to /tmp
icc
Wed, 01/21/2015 - 09:12
Permalink
You must make sure that the
You must make sure that the user running PHP/Apache has write access to the temporary directory, which in your case is /tmp
This is required for uploads to work in PHP. (Unless you've specified another upload_tmp_dir)
I believe this could cause issues with many other PHP apps as well.
Please note that in most linux system /tmp has the permission set "drwxrwxrwt", and that this might be misconfigured on your server.
derek
Wed, 01/21/2015 - 09:31
Permalink
so how do I go about fixing this?
Where do I look, what do I rewrite, do I need to contact someone??
Thanks for the help so far, please remember I only drive the car I am not a mechanic :-)
icc
Wed, 01/21/2015 - 09:45
Permalink
Are you hosting this your
Are you hosting this your self or are you using a hosting provider?
To fix this issue your server admin(root) has to run the following command: chmod 1777 /tmp
No problem, thank you for helping make H5P better for everyone!
derek
Wed, 01/21/2015 - 10:00
Permalink
It is hosted
on host europe de.
I do have access to databases and the php files. I've just found something about chmod on the host site, it doesn't have the command 1777 but has the number 777.
I can paste the text in German or google translated english if that would help
icc
Wed, 01/21/2015 - 10:18
Permalink
You can FTP in and check if
You can FTP in and check if you have a tmp directory, if so try changing the permissions so everyone can write to it.
Most hosting companies have different/special kinds of setups, so best to follow their instructions or just contact them and get them to fix it.
derek
Wed, 01/21/2015 - 10:28
Permalink
can't find a temp dir
So I will contact the host.
Would it be better to change to a wordpress host and start again?
derek
Fri, 01/23/2015 - 20:37
Permalink
Spoke to the host
they said they have given wp permission to write to tmp, however, I am back to square one, attempting to upload and get
derek
Fri, 01/16/2015 - 15:59
Permalink
Logfiles php
I think the php version my server is using for this programme is 5.3, as this is the version the logfiles shows info, my other oprion is 5,4 but no info is shown in that version
derek
Mon, 01/19/2015 - 10:54
Permalink
Any ideas??
Is it better to write a config file and delete the htaccess?
derek
Sun, 01/25/2015 - 21:09
Permalink
I retraced everything
and stiil get the
string(18) "/tmp/libraries.h5p" bool(false)
message when I add the piece of code you gave me before :-(
icc
Mon, 01/26/2015 - 09:07
Permalink
I'm sorry you're having such
I'm sorry you're having such a bad time making this great product work.
Can you please run my last line again:
print (is_writable(sys_get_temp_dir()) ? 'Good, tmp directory is writable!' : 'Not good, PHP cannot write to ' . sys_get_temp_dir()); exit;
If this doesn't return "Good, tmp directory is writable!", PHP isn't able to use its temporary directory, i.e. there is something wrong with your hosting providers setup.
One other thing you could try is replacing line 93 of class-h5p-wordpress.php, it looks like this:
$path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $_FILES['h5p_file']['name'];
But try using this:
$path = WP_TEMP_DIR . '/' . $_FILES['h5p_file']['name'];
Or this:
$path = ini_get('upload_tmp_dir') . '/' . $_FILES['h5p_file']['name'];
Theses lines tries to use other variables to find a temporary directory, this may work if your hosting provider somehow only have changes the dir location partially(some places, but not everywhere).
As for the choice of hosting provider, I would go for someone with great support and a good community for getting help. The providers which has the biggest communities are usually english speaking.
derek
Mon, 01/26/2015 - 09:32
Permalink
Not good, PHP cannot write to TMP MESSAGE
line 93 of class-h5p-wordpress.php, it looks like this:
This is not my line 93
$path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $_FILES['h5p_file']['name'];
This string is not in my class.php file
icc
Mon, 01/26/2015 - 09:46
Permalink
Make sure you are in the file
Make sure you are in the file
plugins/h5p/public/class-h5p-wordpress.php
The line should be inside of:
public function getUploadedH5pPath() {
derek
Mon, 01/26/2015 - 10:00
Permalink
YEEEEEEEEEAAAAAAAAAAAAAAHHHH
What a to do that was, it's uploaded everything after I replaced the original line with:
$path = ini_get('upload_tmp_dir') . '/' . $_FILES['h5p_file']['name'];
*I was also in the wrong file this morning (Mondays? who needs 'em?) can't wait to start playing, thanks for the help & the patience
Derek :-) happy days (fingers crossed)
icc
Mon, 01/26/2015 - 10:16
Permalink
I will add this fix to the
I will add this fix to the plugin to avoid such errors in the future.
Thank you for helping solve this issue.
derek
Mon, 01/26/2015 - 11:27
Permalink
Course presentation editor
doesn't open I get:
icc
Mon, 01/26/2015 - 11:40
Permalink
Does your web server's error
Does your web server's error log say anything?
Also check you browsers error log when creating/editing the content. In Chrome you can open it by pressing (Ctrl + Shift + J).
derek
Mon, 01/26/2015 - 11:49
Permalink
log sever notes
derek
Mon, 01/26/2015 - 11:53
Permalink
In chrome
Uncaught TypeError: Cannot read property 'slides' of undefined
derek
Mon, 01/26/2015 - 11:54
Permalink
on line 15 error says
this.slides = this.presentation.slides; with a red x next to it
icc
Mon, 01/26/2015 - 12:08
Permalink
That is strange. Do you see
That is strange. Do you see the following content types when you press libraries in the H5P Content menu?
Course Presentation (1.2.2)
Course Presentation Editor (1.2.0)
You could try to reinstall the plugin, but make sure it's completely deleted first and that the wp-content/uploads/h5p directory is gone.
After downloading the plugin, remember to apply only the last fix you did to h5p/public/class-h5p-wordpress.php:
$path = ini_get('upload_tmp_dir') . '/' . $_FILES['h5p_file']['name'];
derek
Mon, 01/26/2015 - 12:41
Permalink
Yes, I have those 2 files in the menu
I will try a delete later tonight
derek
Mon, 01/26/2015 - 20:10
Permalink
Still nothing
getting same message as previously
icc
Tue, 01/27/2015 - 08:57
Permalink
What version of the plugin
What version of the plugin are you running? Can you confirm that you have the following two libraries installed?
Course Presentation (1.2.2)
Course Presentation Editor (1.2.0)
derek
Tue, 01/27/2015 - 09:11
Permalink
Version 1,2,2
and yes I have those files.
I also tried the drag n Drop and got the same message. I can do a screen cast if that would help
icc
Tue, 01/27/2015 - 09:50
Permalink
Yes, a short video would be
Yes, a short video would be good. Can you also have the console(Ctrl+Shift+J) open?
derek
Tue, 01/27/2015 - 10:19
Permalink
screencast
hopefully this link works
http://screencast.com/t/I9WYK9njh
icc
Tue, 01/27/2015 - 11:06
Permalink
Ah, I see you're having
Ah, I see you're having trouble loading the libraries into the editor. I'm guessing that your web server doesn't allow reading file content from URLs.
There is a small hack you can do to get around this issue. If you open the file h5p/h5p-editor-php-library/h5peditor.class.php and find line 323, it should look like this:
foreach ($files['scripts'] as $script) {
After this line you add a new line:
$upload_dir = wp_upload_dir(); $script->path = str_replace($upload_dir['baseurl'], '../wp-content/uploads', $script->path);
Now your editor should show, but some of the visuals are missing. To get them working you find line 331 in the same file:
foreach ($files['styles'] as $css) {
And after this line you add:
$upload_dir = wp_upload_dir(); $css->path = str_replace($upload_dir['baseurl'], '../wp-content/uploads', $css->path);
Now everthing should work as expected.
We're hoping to get this issue sorted out in a future version.
derek
Tue, 01/27/2015 - 12:04
Permalink
it's looking good
won't have time to play around til later, but fingers crossed
domoguy
Wed, 01/28/2015 - 17:13
Permalink
WP issue 4.1
When ever i upload the libraries.h5p files i see the loading 0-100% at he buttom of my crome but no libriares are shown it just reloads but nothing to show for? Any help would be appreciated
ALso tried to change persmission to 777 just to make sure but nothing
Server CentoS 6.x
Wordpress .4.1
issue cant uploaded any of the modules for the library (well i does upload but nothing shows up)
icc
Thu, 01/29/2015 - 09:38
Permalink
Can you check your web server
Can you check your web server's error log for messages after uploading? Look at the timestamp to get relevant messages.
What version of PHP are you running on? Thank you.
Pages