Home  >  Article  >  Backend Development  >  代码运作在win5.3.13正常 但是在linux5.2.8 中出现syntax error,unexpected T_STRING

代码运作在win5.3.13正常 但是在linux5.2.8 中出现syntax error,unexpected T_STRING

WBOY
WBOYOriginal
2016-06-13 12:41:56941browse

代码运行在win5.3.13正常 但是在linux5.2.8 中出现syntax error,unexpected T_STRING .
先看代码。

<?php header('Content-type: text/xml'); ?><br />
<?xml version="1.0" encoding="utf-8" ?><br />
<return><br />
	<code><?php echo $code; ?><br />
	<?php if(isset($message)): ?><br />
	<message><?php echo $message; ?></message><br />
	<?php endif; ?><br />
</return>

在本地端运行正常win5.3.13。没有任何错误。
但是在服务器端出现错误。(我不知道服务器端的设置是怎样的。)linux5.2.8

引用
Parse error: syntax error, unexpected T_STRING in /home/XXXXXXXX/emailReturn.php on line 2

然后我在服务器端尝试一一下代码。
<?php header('Content-type: text/xml'); <br />
echo '<?xml version="1.0" encoding="utf-8" ?>'; ?><br />
<return><br />
	<code><?php echo $code; ?><br />
	<?php if(isset($message)): ?><br />
	<message><?php echo $message; ?></message><br />
	<?php endif; ?><br />
</return>

服务器运行正常。请问这是什么错误,为什么会发现这个错误?
PHP 错误
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn