2017-10-06 64 views
-3

对不起,最近我们的国家不能访问谷歌,所以我不能在网络上查询消息,我也是PHP的菜鸟。PHP不能要求包含`_()`的文件

我有一个error.inc.php

<?php 

... 
define("SUC_EXEC_PDNSSEC_REMOVE_ZONE_KEY", _('Zone key has been deleted successfully.')); 
define("SUC_EXEC_PDNSSEC_ACTIVATE_ZONE_KEY", _('Zone key has been successfully activated.')); 
define("SUC_EXEC_PDNSSEC_DEACTIVATE_ZONE_KEY", _('Zone key has been successfully deactivated.')); 

function error($msg) { 
    echo "  <div class=\"error\">Error: " . $msg . "</div>\n"; 
} 

?> 

在我index.php

<?php 

echo "before include"; 
require_once($_SERVER['DOCUMENT_ROOT']."/poweradmin/inc/error.inc.php"); 
echo "included error.inc.php"; # there do not print to the screen when I access the index.php 
... 

您看到的符号,当我访问的index.php,我无法打印该行代码(echo "included error.inc.php";)在我的浏览器屏幕中,意味着此行有require_once($_SERVER['DOCUMENT_ROOT']."/poweradmin/inc/error.inc.php");错误。

我不知道为什么我不能require_once的error.inc.php,我不知道是否是由_()造成的,我不知道_()代表什么。


编辑

而问题主要目的就是为什么error.inc.php不能require_once到的index.php,谁可以告诉我吗?

+0

['_()'](http://php.net/manual/en/function.gettext.php#refsect1- function.gettext-notes)是函数的一个别名['gettext()'](http://php.net/manual/en/function.gettext.php#refsect1-function.gettext-notes)。 – axiac

+2

打开错误报告。使用error_reporting(E_ALL);将其放在脚本的顶部。你应该看看发生了什么 – Akintunde007

+0

@Akintunde在哪里打开它? – aircraft

回答