I am running the following code:
$doc = new DOMDocument();
$doc->loadHTMLFile("http://example.com/"); //Note the url is on the same domain
This works on my development environment but not on my shared environment on Heart Internet.
Why is this and what do I need to do to fix it.
Please note that the following does work!:
$doc = new DOMDocument();
$doc->loadHTML("<div>some more html</div>");
Error message I FINALLY managed to get out of my host:
Notice: DOMDocument::loadHTMLFile(): send of 29 bytes failed with errno=104 Connection reset by peer in /home/sites/bbsbeautyandbrows.com/public_html/wp-content/themes/bbs-beauty-and-brows/inc/CustomPostTypes.php on line 209
Notice: DOMDocument::loadHTMLFile(): send of 2 bytes failed with errno=32 Broken pipe in /home/sites/bbsbeautyandbrows.com/public_html/wp-content/themes/bbs-beauty-and-brows/inc/CustomPostTypes.php on line 209
Notice: DOMDocument::loadHTMLFile(): send of 29 bytes failed with errno=104 Connection reset by peer in /home/sites/bbsbeautyandbrows.com/public_html/wp-content/themes/bbs-beauty-and-brows/inc/CustomPostTypes.php on line 209
Notice: DOMDocument::loadHTMLFile(): send of 2 bytes failed with errno=32 Broken pipe in /home/sites/bbsbeautyandbrows.com/public_html/wp-content/themes/bbs-beauty-and-brows/inc/CustomPostTypes.php on line 209
Update:
This is what heart internet had to say:
Our servers prevent scripts making HTTP (port 80) connections back to the same server that they're running on, as policy.
This is done to prevent the possibility that mis-configured scripts could enter, essentially, an "infinite loop", making call-backs to themselves. Such a situation is extremely detrimental to server performance, and would negatively impact other users also on this shared server.
Unfortunately we are not able to lift this block on a per-site or per-script basis, so you will need to see if you are able to reconfigure the script (or contact the script authors for assistance doing this), or use an alternative script that doesn't require HTTP requests to its own server."