解析错误:语法错误,意外'定义'(T_STRING)

问题描述:

我正在使用php 5.4版本。我从本地主机上传我的Joomla cms文件夹到我的网站主机后出现问题。解析错误:语法错误,意外'定义'(T_STRING)

这是代码

<?php 

defined('_JEXEC') or die; 

JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); 

// Create shortcuts to some parameters. 
$params = $this->item->params; 
$images = json_decode($this->item->images); 
$urls = json_decode($this->item->urls); 
$canEdit = $params->get('access-edit'); 
$user = JFactory::getUser(); 
$info = $params->get('info_block_position', 0); 
JHtml::_('behavior.caption'); 
$useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') ||   $params->get('show_create_date') 
|| $params->get('show_hits') || $params->get('show_category') || $params- >get('show_parent_category') || $params->get('show_author')); 

?> 

我得到这个错误

Parse error: syntax error, unexpected 'defined' (T_STRING) in /home/u854215895/public_html/templates/realestate/html/com_content/article/default.php on line 1

请帮助...谢谢

+0

你在窗户上吗?如果是这样,请确保您的文件具有unix结尾行字符'\ n',而不是窗口'\ r \ n'。 –

从这里

$params- >get('show_parent_category') 
     --^-- 

所以它删除空间像这样。

$useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') ||   $params->get('show_create_date') 
     || $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category') || $params->get('show_author')); 
+0

downvote的原因是什么? –