修改php.ini,把short_open_tag 设为 On
vi etc/php.ini
/short_open_tag
#把默认Off的改成On
:wq
service httpd restart
short_open_tag boolean 决定是否允许使用 PHP 代码开始标志的缩写形式(<? ?>)。如果要和 XML 结合使用 PHP,可以禁用此选项以便于嵌入使用 <?xml ?>。否则还可以通过 PHP 来输出,例如:<?php echo '<?xml version="1.0"'; ?>。如果禁用了,必须使用 PHP 代码开始标志的完整形式(<?php ?>)。
Note:
本指令也会影响到缩写形式 <?=,它和 <? echo 等价。使用此缩写需要 short_open_tag 的值为 On。 从 PHP 5.4.0 起, <?= 总是可用的。 参考:http://php.net/manual/zh/ini.core.php