在写这行的字符串被终止: - PHP的错误:函数必须在CodeIgniter的constants.php
define('APPLICATION_ROOT', $_SERVER('DOCUMENT_ROOT'));
在constants.php
在CodeIgniter的框架,我得到错误Error :Function must be terminated with a string
。我可以不使用constants.php中的超级全局数组吗?
在写这行的字符串被终止: - PHP的错误:函数必须在CodeIgniter的constants.php
define('APPLICATION_ROOT', $_SERVER('DOCUMENT_ROOT'));
在constants.php
在CodeIgniter的框架,我得到错误Error :Function must be terminated with a string
。我可以不使用constants.php中的超级全局数组吗?
我没有CI的实例起来的那一刻,但不应该该行是:
define('APPLICATION_ROOT', $_SERVER['DOCUMENT_ROOT']);
(与方括号,而不是括号)
define('APPLICATION_ROOT', $_SERVER['DOCUMENT_ROOT']);
支架[],而不是括号。
虽然我会建议不要这样做。常量应该是恒定的。 $ _SERVER ['DOCUMENT_ROOT']可能没有定义,或者在您使用它的任何地方都是一样的。