failed upload of new question
Hi - we installed H5P on our test server running WP 3.2.1 and it worked beautifully - THe test server is on an linux server on AWS
So installed on our live site on the University server - same version of WP and H5P. The plugin installed ok, but hwne we tried to upload a file via the upload new question option we get:
failed to open stream: Read-only file system xxx/wp-content/plugins/h5p/admin/class-h5p-plugin-admin.php on line 395
(the line code on this file is "rename($_FILES['h5p_file']['tmp_name'], $interface->getUploadedH5pPath());)"
If we try and upload directly into the library we get:
Warning: file_get_contents: failed to open stream: no suitable wrapper could be found in xxxx/wp-content/plugins/h5p/h5p-php-library/h5p.classes.php on line 2304
This is a multisite installation and we have tried network and single site installation - neither work.
falcon
Sun, 10/04/2015 - 21:53
Permalink
Thank you for reporting. We
Thank you for reporting. We've added this issue to our backlog. You'll be notified here as soon as your issues has been handled.
If you should need a support arrangement for H5P you may contact an H5P Service Provider.
Timca
Thu, 10/15/2015 - 13:55
Permalink
more info
according to our IT the libraries upload is failing becuase open URLs are blocked by our server as a security measure - so we get this error messsage
Warning: file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /xxx/wp-content/plugins/h5p/h5p-php-library/h5p.classes.php on line 2305
Is there any way we can upload /create questions into H5P without cahnging this (which we cant do!)
icc
Thu, 10/15/2015 - 15:24
Permalink
What version of the plugin
What version of the plugin are you using? This should have been fixed a while ago, and you should be able to upload files without allow_url_fopen enabled.
Timca
Thu, 10/15/2015 - 15:35
Permalink
version is
H5P v 1.5.4 . Its not saying there are any updates available?
WP is version 4.2.5
icc
Thu, 10/15/2015 - 16:30
Permalink
Ok, then it's very strange
Ok, then it's very strange that you receive this error. Do you have access to the plugin files so that you can debug? If you add the following before line 2305 in h5p/h5p-php-library/h5p.classes.php:
And then try to upload the file, it should tell us which part that is failing.
Timca
Thu, 10/15/2015 - 16:56
Permalink
Result
Thanks for this - we added the code and got the attached json - I've also attached an image how the library page looks when trying to add file
icc
Thu, 10/15/2015 - 17:15
Permalink
Ok, thank you. Since this
Ok, thank you. Since this code isn't really used it should be safe to remove it. If you can uncomment or remove the lines 1317 and 2002 you should get rid of these messages. The two lines should both contain:
Let me know how it goes.
Timca
Thu, 10/15/2015 - 18:18
Permalink
No Luck
Sorry but no luck. Still getting the same error
icc
Fri, 10/16/2015 - 09:09
Permalink
I have to apologize, it seems
I have to apologize, it seems like I was looking in the wrong place. This is indeed a bug, you should undo your previous changes or just re-install the plugin. To fix these errors you simply have to replace line nr 175 in h5p/admin/class-h5p-library-admin.php. It looks like this:
But it should look like this:
I have added this fix to the plugin, so it will be part of the next version.
Thank you for reporting this issue!
Timca
Fri, 10/16/2015 - 10:10
Permalink
Read only file
Thanks. Have tried this and the error message re the open URL has gone, but still getting this:
Sessions/drag-the-words-1399.h5p): failed to open stream: Read-only file system xxx/wp-content/plugins/h5p/admin/class-h5p-plugin-admin.php on line 395
and
so not able to upload
icc
Fri, 10/16/2015 - 11:56
Permalink
Ok, is seems like you were
Ok, is seems like you were having two separate issues. This last one seems to be cause by PHP not being able to write to its tmp folder. This is the folder configured in php.ini as 'upload_tmp_dir', or if not present sys_get_temp_dir() is used. Are there any reasons why you've set up PHP without a writable tmp directory?
You can get around this by setting another tmp path in public/class-h5p-wordpress.php:93, but I would recommend just setting the 'upload_tmp_dir' in php.ini to something usable.
Timca
Mon, 10/19/2015 - 20:29
Permalink
Resolved
Unfortunately the server is controlled by the University IT, so php.ini is not availble to us - so changed the path destination for the temp folder and this worked.
Thanks for all your help