Answer the question
In order to leave comments, you need to log in
Why does DOMDocument::loadXML work differently on Apache on Windows and Linux?
Development PC - Apache 2.2 + PHP Version 5.3.28 - Windows 8.1 x64
Production Server - Apache 2.2 + PHP Version 5.3.10 - 1Ubuntu3
$options = array(
'http' => array(
'header' => "Content-Type: application/x-www-form-urlencoded\r\n",
'header' => "Authorization: Basic " . $auth . "\r\n",
'method' => 'POST',
),
);
$context = stream_context_create($options);
$url = 'http://192.168.0.159/ClientCabinet/hs/clientinf/getinfo';
$result = @file_get_contents($url, false, $context);
$dom = new domDocument("1.0", "utf-8");
$dom->loadXML($result);
Answer the question
In order to leave comments, you need to log in
Apache has nothing to do with it. PHP Version 5.3.28 and PHP Version 5.3.10 are at least different versions of php. 99,(9)% that the settings are also different (php.ini). Maybe you have xdebug somewhere, maybe something else.
remove the dog, get an error. If you see an error, fix the problem. most likely file_get_contents returns an empty string because it could not download the file and the errors were suppressed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question