【问题标题】:Parse error: syntax error, unexpected 'defined' (T_STRING)解析错误:语法错误,意外的“定义”(T_STRING)
【发布时间】:2013-12-13 21:18:51
【问题描述】:

我使用的是 php 5.4 版本。将我的 Joomla cms 文件夹从本地主机上传到我的虚拟主机后,我遇到了问题。

这是代码

<?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'));

?>

我收到这个错误

解析错误:语法错误,第 1 行 /home/u854215895/public_html/templates/realestate/html/com_content/article/default.php 中的意外“定义”(T_STRING)

请帮忙...谢谢

【问题讨论】:

  • 你在 Windows 上吗?如果是这样,请确保您的文件具有 unix 结束行字符 \n 而不是 windows \r\n

标签: php


【解决方案1】:

从这里删除空间

$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'));

【讨论】:

    猜你喜欢
    • 2015-02-24
    • 1970-01-01
    • 2013-05-13
    • 2014-05-12
    • 1970-01-01
    • 1970-01-01
    • 2020-04-23
    • 2016-03-05
    • 2011-04-02
    相关资源
    最近更新 更多