0

错误:

[xmlreader.open]: failed to open stream: HTTP request failed! HTTP/1.0 500 Internal Server Error in /var/www/html/www/main_web_mobile/index.php on line 54

Warning: XMLReader::open() [xmlreader.open]: Unable to open source data in /var/www/html/www/main_web_mobile/index.php on line 54

Warning: XMLReader::read() [xmlreader.read]: Load Data before trying to read in /var/www/html/www/main_web_mobile/index.php on line 59

代码:

<?      $z = new XMLReader;
        $z->open('http://URL_HERE');

        $doc = new DOMDocument;

        while ($z->read() && $z->name !== 'item');

        while ($z->name === 'item')
        {
            $node = simplexml_import_dom($doc->importNode($z->expand(), true));
            ?>
            <h2 class="acc_trigger"><a href="#"><?php echo $node->title; ?> | <strong><?php echo $node->speciality; ?></strong></a></h2>
            <div class="acc_container">
                <div class="main_text">
                    <div class="title"><?php echo $node->title; ?> |<strong> <?php echo $node->speciality; ?></strong></div>
                    <div class="text_holder"><?php echo $node->descriptionWithoutImage; ?></div>
                    <div class="img_holder"><img src="<?php echo $node->image; ?>" alt="" /></div>
                </div>
               <a href="tel: <?php echo $numberbefore; ?>"><div class="btn_holder"><?php echo $number; ?><br /><div class="call_now"><div class="extention"><?php echo $node->internalNumber; ?></div></div></div></a>
            </div>
            <?php 
            $z->next('item');
        }
        ?>
4

2 回答 2

2

从错误中可以清楚地看出,http://URL_HERE您的服务器无法访问。要么你有网络限制;要么 或allow_url_fopen在您的服务器上被禁用。

于 2013-07-22T12:17:21.363 回答
0

http://URL_HERE当您在浏览器中输入内容时,您可以访问您的文件吗?

问题可能是您主机的访问限制,例如尝试更改 chmod。

于 2013-07-22T12:11:17.590 回答