Php DOMDocument ::load() works locally but not on the phpfog cloud
I've written a small php script which uses the DOMDocument object to read xml from an external domain. The script works perfectly when hosted locally but doesn'开发者_高级运维t work when hosted on the phpfog cloud.
$mlDoc = new DOMDocument();
$xmlDoc->load($url);
I've checked the url which is produced prior to the load call and it's fine. As far as I'm aware the method shouldn't be affected by where it is called from (local machine or external).
Any thoughts?
Thanks.
It is probably because PHPFog has disabled url wrappers in PHP
https:// wrapper is disabled in the server configuration by allow_url_fopen=0
It's possible the PHPFog cloud has disabled the DOM extension (either explicitly with --disable-dom
or implicitly because they passed --disable-libxml
). If neither of these things are true, can the PHPFog machine access $url
? You might try file($url)
if the fopen wrappers are enabled, to see if the machine can access the URL (or try opening a socket to port 80 after resolving the domain).
精彩评论