Error file_get_content

Hi :-)

We host a lot of WebUzo serveres with many Wordpress installations on, when we try to use H5P on these installations we get the following error:

When we click on libraries in admin - H5P :

Warning: file_get_contents( failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in /home/uzoadmin/public_html/ on line 2114


Can someone give me an hint where to look?

Kind Regards


icc's picture

That is really strange. It seems like the URL is returned by php's realpath(). When I try to open the link you specified it works. 

It could be that your webserver reseponds differently to your localhost. Can you try accessing the URL from a shell on your server? e.g.:

You could also just "hack" around the supported libraries check by adding:
after this line:
public function validateLibrarySupport($force = false) {
in h5p/h5p-php-library/h5p.classes.php.

But then be sure that you're not using really old versions of the content types from



Hi icc

Thanx for helping me :-)

The "hack" you suggested it not do the trick and when I try the wget command I get the following error:




Connecting to||:80... connected.

HTTP request sent, awaiting response... 404 Not Found

2015-02-17 05:20:29 ERROR 404: Not Found.


No problem with the wget command from another host.  

I have been looking everywere (I think :-) ) but can not find any config mistakes. Can you give me any hint where to look?


Kind regards



icc's picture

First off, it seems like your server is misconfigured. Either your domain should point to, OR your web server should listen to request from the ip address as well. It's probaby the /etc/hosts file that maps the domain to the wrong ip.

Secondly the realpath function seems to return a url, which is indeed strange. Have the server got some kind of special file system or compiled/patched PHP?
If you could insert the following line just before line 2114 of h5p.classes.php, we might get some more debugging info:
var_dump(__FILE__); var_dump(dirname(__FILE__)); var_dump(realpath(dirname(__FILE__))); exit;


I dont hope it is misconfigured - It is an Webuzo deployment with more that 20 wordpress installations - all in good conditions and working - a lot of plugins, themes ect. But it is on Webuzo based administration platform - so you might be right that it is not standalized according to a standalone installed apache with php.


It is using a standard php version 5.6 with no changes in php.ini except upload limits.

Here is the debuging information:

string(101) "/home/uzoadmin/public_html/" string(85) "/home/uzoadmin/public_html/" string(85) "/home/uzoadmin/public_html/"

The paths from the debug is the actual path on the linux server


BUT - I added the hostname with the internal ip address to the hosts file - and everything startet working :-)

 Thx again for your help :-)