简体   繁体   中英

no serialized xml response when calling a php/cake web app

I've got a strange behavior in a web app written with PHP 5/cake running on centos. The issue is this: I'm calling an API to return XML formatted data from MySql. If the total data size is small, all works fine.

But when the result includes thousands of data elements (pairs of timestamp/value) the xml serialize function fails to return the xml response. It actually looks like the thread died, maybe due to an exception?

Here's the code - this is , after I got the data ok from the db: ,在我从db中获得数据确定之后:

<?php
header("Content-Type: text/xml");
e('<?xml version="1.0"?>');

echo 'before serialize';
e($xml->serialize2($msg, array('format' => 'tags')));
echo 'after serialize';

e($this->element('sql_dump'));

?>

I don't see the 'after serialize' output.

$xml->serialize() is part of

function serialize($data, $options = array()) {
$options += array('attributes' => false, 'format' => 'attributes');
$data =& new Xml($data, $options);
return $data->toString($options + array('header' => false));
}

it looks like this line is causing the problem:

$data =& new Xml($data, $options);

I've searched for this problem everywhere without any luck.

Any help would be greatly appreciated!

Thx

Ofer

问题已解决-我将php.ini中的memory_limit从32M增加到512M。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM