2017-10-06 106 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

回答