我在这里发生了一件很奇怪的事情。本地代码运行良好,但是当我将其上传到Web服务器时,我得到一个分析错误:解析远程服务器上的错误,但不是本地codeigniter
解析错误:语法错误,意外的T_STRING在/path/to/codeigniter-site.com/data/application/中意见/ locationsXml.php第2行
有说“locationsXml.php”的内容:
<?php header('Content-Type: text/xml'); ?>
<?xml version="1.0" encoding="ISO-8859-1"?>
<locations>
<?php if (!empty($locations)) foreach ($locations as $location) : ?>
<location id="<?php echo $location->id; ?>" active="<?php echo $location->active; ?>">
<name><?php echo $location->name; ?></name>
<long><?php echo $location->long; ?></long>
<lat><?php echo $location->lat; ?></lat>
<country><?php echo $location->country; ?></country>
</location>
<?php endforeach; ?>
</locations>
就像我说的,这个运行良好本地 - 我的本地PHP版本5.3.1是和远程PHP版本是5.3.2非常令人沮丧!
预先感谢任何帮助或建议
你应该在本地显示错误和远程禁用它们:P – HamZa 2013-02-14 08:46:00
<?是一个PHP短标签,因此echo'<'。'?xml version =“1.0”encoding =“ISO-8859-1”?'。'>'; – Waygood 2013-02-14 08:46:14
@ThePHPUnicorn,并记住,从服务器到服务器总是有差异 – afarazit 2013-02-14 08:50:13