【发布时间】:2015-12-07 11:04:22
【问题描述】:
我有 CodeIgniter 3.0.0,我在 1and1.com 上托管,我使用的是 PHP 5.5。我正在工作的网站曾经在我上次工作时工作。今天,我尝试加载网站,我看到了(我删除了部分路径以不显示我的用户信息):
Parse error: syntax error, unexpected T_ARRAY, expecting ')' in /htdocs/_smchorus/system/core/Common.php on line 238
我认为唯一可能发生变化的是我记得最近在 1and1.com 管理面板上从 php 5.4 迁移到 5.5。我不确定为什么会破坏它。我并没有真正弄乱codeigniter的系统代码。我尝试回到 5.4 并没有解决它。
这一行:
function get_config(Array $replace = array())
第 238 行有问题。
if ( ! function_exists('get_config'))
{
/**
* Loads the main config.php file
*
* This function lets us grab the config file even if the Config class
* hasn't been instantiated yet
*
* @param array
* @return array
*/
function get_config(Array $replace = array())
{
static $config;
if (empty($config))
{
$file_path = APPPATH.'config/config.php';
$found = FALSE;
if (file_exists($file_path))
{
$found = TRUE;
require($file_path);
【问题讨论】:
-
不确定是否不相关,但您是否更改了您的
config文件? CI 应该适用于 PHP 5.4 及更高版本。 -
我不知道这会如何工作:
function get_config(Array $replace = array())... 是array,而不是Array,除非 CodeIgniter 有一个名为Array的类。 -
我猜你的一个配置文件有问题(可能是 config.php 中的拼写错误或类似的东西)配置应该始终是一个数组@这将在 CI 核心中并且可以工作完全没问题...
-
我只能在 PHP 4.4.9 sandbox.onlinephpfunctions.com/code/…987654321@ 上重新创建这个确切的错误
-
传递给
get_config()的参数导致错误。仔细检查您的配置文件是否有语法错误。
标签: php codeigniter syntax-error