Adding libraries (wordpress)

Hi All,

I have recently installed H5P as a plugin on wordpress. However I do not have any libraries currently. When I go to add a library and select the file to upload it seems to work okay (you see the file is uploading). But once it has completed it still has no libraries., just 'N/A'. Would anyone be able to assist?

Ideally I would just put the library in the correct folder via FTP, is this an option?

Thanks,

Dan

falcon's picture

What library are you trying to upload? Are you using this guide?

Yes, I am using the guide you link to and the file which is in the guide.

I have tried using both the full library and individual library files. I have tried ticking the box about unknown file extensions and tried having it unticked. I get teh same outcome regardless (it appears to be upload but then no new libraries display).

falcon's picture

You are logged in as an administrator? Are you able to upload files as big or bigger to your media library?

Hi. I am logged in as administrator and I have just tried to upload a larger file into my media library successfully. Thanks for your help and quick responses, it is really apprecaited.

falcon's picture

Ok, I'm out of ideas then. I'll ask icc to look into this. He knows Wordpress a lot better than me...

Really apprecatie it, thank you.

icc's picture

Can you please check your web server's error.log for php errors. Also make sure the wp-content/uploads directory is writable by the user running php. Unfortunately you cannot upload/install H5P content types through FTP.

Also you can check phpinfo() to see if php is compiled with zip support, and that it's enabled.

Hi iCC,

Many thanks for your suggestions. I have just created a fresh install of Wordpress to see if it might be something strange with my site but this didn't solve it. I have enabled logging and checked the error log. I did have the following error relating to H5P:

"[Tue Nov 18 16:25:29.300486 2014] [log_config:warn] [pid 15380:tid 34397403136] (32)Broken pipe: [client 172.17.240.2:27263] AH00646: Error writing to |/nfsn/bin/apache_log_client, referer: http://ln.nfshost.com/wp-admin/admin.php?page=h5p_libraries"

I appreciate this is poor security practice but I set the group owner of all folders to web and gave it write access, so I don't think it can be a permissions issue.

I have run a PHPinfo() plugin which has provided the following although it doesn't seem to contain anything regarding .zip support.

Thank you so much for your help with this. The plugin looks incredibly useful. I am working on building a free language site for people looking to learn Norwegian and this tool hopefully wiil be the main method of providing content.

Thanks in advance for your help.

Dan

PHP information for http://ln.nfshost.com

 

max_execution_time: 180

max_input_time: 180

file_uploads: 1

upload_max_filesize: 10M

post_max_size: 10M

register_globals: 

safe_mode: 

allow_url_fopen: 1

eaccelerator.enable: 

 

 

Other information:

 

PHP Server API: NFGI

WordPress Version: 4.0

WordPress Blog URI: http://ln.nfshost.com

WordPress Installation URI: http://ln.nfshost.com

WordPress Theme: /wp-content/themes/twentyfourteen

WordPress Permalink Structure: 

WordPress wp-content directory is writable

WordPress does not use Gzip Compression

WP-Cache is not running on this installation of WordPress

GD library is installed

PHP Version: 5.5.19-nfsn1

MySQL Version: <br />

<b>Warning</b>:  mysql_get_server_info(): No such file or directory in <b>/home/public/wp-content/plugins/phpinfo/phpinfo.php</b> on line <b>127</b><br />

<br />

<b>Warning</b>:  mysql_get_server_info(): A link to the server could not be established in <b>/home/public/wp-content/plugins/phpinfo/phpinfo.php</b> on line <b>127</b><br />

 

Browser used: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36

Configurationphp_inivaluePhp scripts are allowed to run for 180 secondsmax_execution_time180Your webserver won't wait for form data longer than 180 secondsmax_input_time180File uploads are enabledfile_uploads1File Uploads are limited to 10Mupload_max_filesize10MPost data is limited to 10Mpost_max_size10MGlobal variables are not registeredregister_globals Safe Mode is Offsafe_mode Remote files can be opended by fopen()allow_url_fopen1eAccelerator is not enabledeaccelerator.enable

 

 

Hi icc, thank you for your help. I have checked that the phpinfo() does allow zip support. I am struggling with permissions to get teh error log up and running once I have that I will post again - thanks for such a quick reply.

icc's picture

That does sound like a really cool website project!

I'm sorry to hear that you're having issues, and I cannot see any obvious reason as to why it should fail. Your php-config looks fine.
What database-server are you using, MySQL?

What happends when you go to the "Add New", select upload and upload the file from Memory Game? Any errors in the log? 
Please make sure that PHP has error logging turned on, and that you are checking the correct log file for your vhost. (where other php errors go if you open your index.php and write some gibberish)
If you can enabled WP_DEBUG and try uploading, that might give us some more error information.

I'm guessing that the issue is related to the LAMP setup, and I see that the hosting provider is using Squid. That shouldn't be an issue, but I've never tested H5P using Squid.

Hi Again,

Yes I am using MYSQL . I don't actually get the option of the memory game when I try to upload a new file. The list has no options available. I have been trying to hunt down friends with more technical knowledge to assist me in this but have been struggling. My hosting is with NearlyFreeSpeech and is setup as they suggest in thier tutorial. I think it is quite focused on security so I assume it probably relates to permission somewhere causing the issue but have no idea where.

I slightly wondered if you could see anything from this tutorial that might explain the issue: 

https://faq.nearlyfreespeech.net/section/gettingstarted/installwordpress...

Any suggestions would be greatly apprecaited. I would also happily send you the login details if you might be able to take a look yourself for me?

Any help would be hugely apprecaited, really keen to get this project going.

Thanks,

Dan

 

icc's picture

Yes, it sounds like it might be a permission issue. If you send the login info and details to frode.petterson at joubel.com, or use the contact form, I'll have a look at your setup. You can just change the password afterwards.

Sent, thank you.

icc's picture

As it turns out, there's an issue in some php builds when using filter_input's INPUT_SERVER, ref: http://php.net/manual/en/function.filter-input.php#77307

This can be fixed in the H5P plugin's code by using $_SERVER instead.

This fix will be a part of the next version of the plugin.

Thank you for contributing to finding and solving this bug!

 

 

Hello, 

has the filter_input fix been added already?

I am having troubles uploading the libraries.h5p in Wordpress. I always get the 500 Internal Server Error. Unfortunately I don't have access to the server logs.

I've tried to upload h5p content types individually. Some work and some don't. Image Hotspot Question and Memory Game work but Course Presentation and Interactive Video cause the 500 Internal Server Error. 

Any info?

Thank you  & kind regards

The problem has been solved already! :-)

I've reached the server administrator. The culprit was the firewall. 

Maybe same problem. Tried to upload libraries, following the guide. Memory size ok, I am admin etc. After 100% upload, the screen refreshes and then 500 Internal Server Error. Is there any how-to or any solution for this?

icc's picture

What does your web server's error log say?

[Tue Jan 06 18:58:14 2015] [warn] [client [redacted]] mod_fcgid: HTTP request length 131991 (so far) exceeds MaxRequestLen (131072), referer: http://[redacted]/wp-admin/admin.php?page=h5p_new

That's strange, the library is only 1,63MB on disk.

icc's picture

It sounds like you might have the default value for the FcgidMaxRequestLen directive. Which is only like ~128 KB.
http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#fcgidmaxrequestlen

I guess it should match the max post size set for PHP. 

We had similar issues and it turned out that there was first a problem with the rigths on /wp-content:

http://stackoverflow.com/questions/640409/can-i-install-update-wordpress-plugins-without-providing-ftp-access
(The entry that helped was (the first) from: answered Apr 13 '11 at 13:25  stereoscott)

However, we are not yet able to upload bigger files.  We will check the "FcgidMaxRequestLen" 

Thanks, I didn't knew they are bytes... Done, now it's working, BUT a new error message appears: 

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

Error log:

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id'; check that column/key exists for query ALTER TABLE `adrk_h5p_contents` DROP INDEX `id` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id_0'; check that column/key exists for query ALTER TABLE `adrk_h5p_contents` DROP INDEX `id_0` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id_1'; check that column/key exists for query ALTER TABLE `adrk_h5p_contents` DROP INDEX `id_1` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id_2'; check that column/key exists for query ALTER TABLE `adrk_h5p_contents` DROP INDEX `id_2` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id_3'; check that column/key exists for query ALTER TABLE `adrk_h5p_contents` DROP INDEX `id_3` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id_4'; check that column/key exists for query ALTER TABLE `adrk_h5p_contents` DROP INDEX `id_4` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'content_id'; check that column/key exists for query ALTER TABLE `adrk_h5p_contents_libraries` DROP INDEX `content_id` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'content_id_0'; check that column/key exists for query ALTER TABLE `adrk_h5p_contents_libraries` DROP INDEX `content_id_0` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'content_id_1'; check that column/key exists for query ALTER TABLE `adrk_h5p_contents_libraries` DROP INDEX `content_id_1` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'content_id_2'; check that column/key exists for query ALTER TABLE `adrk_h5p_contents_libraries` DROP INDEX `content_id_2` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'content_id_3'; check that column/key exists for query ALTER TABLE `adrk_h5p_contents_libraries` DROP INDEX `content_id_3` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'content_id_4'; check that column/key exists for query ALTER TABLE `adrk_h5p_contents_libraries` DROP INDEX `content_id_4` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id'; check that column/key exists for query ALTER TABLE `adrk_h5p_results` DROP INDEX `id` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id_0'; check that column/key exists for query ALTER TABLE `adrk_h5p_results` DROP INDEX `id_0` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id_1'; check that column/key exists for query ALTER TABLE `adrk_h5p_results` DROP INDEX `id_1` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id_2'; check that column/key exists for query ALTER TABLE `adrk_h5p_results` DROP INDEX `id_2` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id_3'; check that column/key exists for query ALTER TABLE `adrk_h5p_results` DROP INDEX `id_3` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id_4'; check that column/key exists for query ALTER TABLE `adrk_h5p_results` DROP INDEX `id_4` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries` DROP INDEX `id` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id_0'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries` DROP INDEX `id_0` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id_1'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries` DROP INDEX `id_1` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id_2'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries` DROP INDEX `id_2` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id_3'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries` DROP INDEX `id_3` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:16 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'id_4'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries` DROP INDEX `id_4` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:17 2015] [warn] [client [redacted]] mod_fcgid: stderr: raries` DROP INDEX `library_id` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:17 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'library_id_0'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries_libraries` DROP INDEX `library_id_0` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:17 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'library_id_1'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries_libraries` DROP INDEX `library_id_1` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:17 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'library_id_2'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries_libraries` DROP INDEX `library_id_2` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:17 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'library_id_3'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries_libraries` DROP INDEX `library_id_3` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:17 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'library_id_4'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries_libraries` DROP INDEX `library_id_4` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:17 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'library_id'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries_languages` DROP INDEX `library_id` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:17 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'library_id_0'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries_languages` DROP INDEX `library_id_0` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:17 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'library_id_1'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries_languages` DROP INDEX `library_id_1` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:17 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'library_id_2'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries_languages` DROP INDEX `library_id_2` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:17 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'library_id_3'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries_languages` DROP INDEX `library_id_3` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:17 2015] [warn] [client [redacted]] mod_fcgid: stderr: WordPress database error Can't DROP 'library_id_4'; check that column/key exists for query ALTER TABLE `adrk_h5p_libraries_languages` DROP INDEX `library_id_4` made by activate_plugin, do_action('activate_h5p/h5p.php'), call_user_func_array, H5P_Plugin::activate, H5P_Plugin::check_for_updates, H5P_Plugin::upgrade_120, H5P_Plugin::remove_duplicate_indexes, referer: http://[redacted]/wp-admin/update.php?action=install-plugin&plugin=h5p&_wpnonce=f0d45b0415

[Wed Jan 07 19:22:19 2015] [warn] [client [redacted]] mod_fcgid: stderr: PHP Warning:  Invalid argument supplied for foreach() in /var/www/clients/client16/web140/web/wp-content/plugins/h5p/public/class-h5p-plugin.php on line 744

 

icc's picture

Thank you for providing the error log. Most of these messages are warnings about dropping some old indexes and can safely be ignored. The last message is a warning about cleaning up temporary files, which you have none of. This warning has been removed and will not appear after the next version of the plugin.

Which .h5p file are you trying to upload? I'm guessing you're at the "Add new" form. It could be that the file has no example content in which case you need to upload it under the "Libraries" section.

Sorry, I was using the Add New / Upload instead of adding the libraries you provide here: http://h5p.org/update-all-content-types. I wasn't attentive of the steps involved the first time I use H5P in Wordpress. So, now time to crunch H5P :) 

febster's picture

Sorry, I not a super technical person, so much of what you are talking about in this feed goes over my head. However, I do have the same exact problem as described here. I go to upload the files in 'libraries' within the H5P plugin, and it only spits out an 'N/A' result, without uploading anything. I'm trying to upload all the libraries at once. But I have tried others individually to no avail... Everything mentioned here I have tried...Is there a simple fix to this issue? I'm debating hiring someone to fix it for me, as the technical language quickly gets beyond me (I know fundamental CSS/HTML...etc...only).

Any straightforward solutions?

febster, you may have made the same mistake as me, so I share here again. If you said the memory problems were solved out (being them php.ini and/or the apache directive, both require some admin access to the server, so get some help from an sysadmin), after you install the plugin, you have to use the "Libraries" Menu under H5P, and not "Add New" Menu. That confused me too, and tried to "add new" the libraries, which in fact tries to add a new h5p component to use sitewide, based on the already uploaded libraries (=sort of templates). So, again, the first thing is to add the libraries through the "Libraries" menu, it's straightforward.

febster's picture

Hey there! Many thanks for your response. Yes, I've been using exactly the upload location labelled 'libraries'.

Here's a video that should show you exactly what is happening: http://screencast.com/t/mb4UTnwQB2 

It's 2 minutes in length. Just trying to formulate how I should present this to Wordpress host provider to be most easily fixed.

There's an issue then with the phpini/apache directive? (I don't understand what this means, but if I say it, perhaps my host will know...). Any other lingo to use perhaps to lead my host down the right track? Again, I really appreciate the suggestions! Regards, Timothy :-)

febster's picture

For some reason, you have to copy and paste the above video link into the address box to view it. I won't immediately appear just by clicking on it...Don't know why...

You are doing it correctly. Now, to debug the problem, you should obtain a copy of server error log file from your server (in my Apache webserver installation is error.log), and put here the errors/messages that appeared near the timestamp of your failed upload. There would be some verbiage referencing h5p plugin/directory, so it's easy to spot the lines. Then this lines will tell exactly what was wrong. For security reasons, don't forget to redact any real URL/IPs might appear in the error messages.

If you have access by FTP to your server files, the error.log is usually in the [root]/log/ directory. Or you can surely do a search for this file and the highest in directory structure is the one you'll look for. If you do not have admin access to you webserver, ask the host to send you this file. You then can open it with Notepad or any other text editor from your desktop. If you encounter an error when opening .log file types, just choose a text editor from your desktop, you'll be able then to view the log file (it's just a plain text with .log extension).

The mentioned Apache directive fix is only doable by the admin (usually), but you don't know yet this is the case. All the answers lies in the error.log :)

febster's picture

Thank you so much! Yes, will indeed follow up on what you've shared here with my host. Many thanks for your time and willingness to look into it! Regards, Timothy

Sorry, I omit to suggest you that you share the said portions of error.log here, so the folks at H5P can debug and maybe solve any similar problems in the future, as this is an Open Source Project and all is in collaboration :) If you will do that, pls don't forget to redact things.

Regarding this "confusion", maybe a better name for the "Add New" menu item might be "Create", which is more or less the same thing, but less confusing. I try to understand why I did wanted to do what I did, and I think the "Add New" is something usual for a WP workflow, meaning that one tries to get, or install smth from outside WP (which is the case for these libraries). But anyways, why aren't these libraries included with the plugin install? 

icc's picture

I understand the confusion. We're planning on creating a smoother process for selecting the interactive content types you want on your site, and then downloading them automatically.

We're planning on getting loads of content types and therefore we cannot include everything, some people just wants the memory game.

I have a similar problem while uploading new libraries. Regardless of the size (full package or just one content type), it won't upload and shows N/A at the libraries installed.

I found out that there has to be a problem with the upload, because it renders the html for "error" and it even renders the div/ul/li for a message, but the message is not there / is a null-string. As I cannot access the server error logs (no server admin rights), I tried to enable WP debugging, but it won't even create a debug.log (yes, permissions are granted, I set them to 777 testwise, but it won't write an error log). So I cannot check for the error at all.

Does any one here know, why this upload-error could occur, and why it won't show me an error message, even if the HTML is rendered accordingly? I'm very convinced that it has to be one of the seven known PHP upload errors, and H5P has a neat list of them, but they won't show up in my HTML. If I just could display the error, I could go to my IT admin and convince him to help me checking the server variables and error logs, which he denies me at the moment, because he says that it's a Wordpress only problem.

Attachments: 
icc's picture

My guess would be filesystem permissions, but it's difficult to know without seeing the application error log messages. It could be something else related to the server setup. Try adding the following to your wp-config.php and see if that makes the error messages appear:

define('WP_DEBUG', true);
error_reporting(E_ERROR | E_WARNING | E_PARSE);

Without access to your application logs your best bet is probably one of those plugins that create logs for you.

Also, you could try reinstalling the plugin, as it should automatically download the content types.

icc: thank you!

I finally managed to debug. The debug.log showed me this message:
PHP Notice:  Undefined offset: 0 in .../wp-content/plugins/h5p/admin/class-h5p-library-admin.php on line 283

I looked it up in the code. In the end, there was no upload error at all (0 means that it was successfull) but it always got into the "else" loop, where it tried to define an error that wasn't there.

I just wrote some string quotes around the 0, so

if ($_FILES['h5p_file']['error'] === 0)

would become

if ($_FILES['h5p_file']['error'] === '0')

and finally, the libraries are uploading.

Strange - but at least, it worked!

icc's picture

That is strange, are you using any special build of PHP, which version are you running and on which operating system? 

Thanks for sharing the solution. I've updated the code that checks for errors to be less strict so we can avoid such issues in the future: 09f406c
I'm happy that you got it working!

It was a script of our sysadmin, that caused that thing... he appologised and now it works like intended. Thank you very much for the answer, because they helped me a lot to find the problem!

icc's picture

I'm glad you managed to figure it out!