我对我的opencart网站感到困惑,因为我使用MAMP将我的网站从ftp服务器迁移到我的localhost我无法使用它,因为/ admin只返回黑页。我检查了我的PHP日志:
[23-Jul-2015 12:48:16 Europe/Paris] PHP Notice: Undefined index: in /Applications/MAMP/htdocs/uta/admin/index.php on line 151
[23-Jul-2015 12:48:16 Europe/Paris] PHP Notice: Undefined index: in /Applications/MAMP/htdocs/uta/admin/index.php on line 152
[23-Jul-2015 12:48:16 Europe/Paris] PHP Notice: Undefined index: in /Applications/MAMP/htdocs/uta/admin/index.php on line 156
[23-Jul-2015 12:48:16 Europe/Paris] PHP Notice: Undefined index: in /Applications/MAMP/htdocs/uta/admin/index.php on line 157
[23-Jul-2015 12:48:16 Europe/Paris] PHP Notice: Undefined index: in /Applications/MAMP/htdocs/uta/system/library/Translation.php on line 371
[23-Jul-2015 12:48:16 Europe/Paris] PHP Notice: Undefined index: in /Applications/MAMP/htdocs/uta/system/library/Translation.php on line 371
[23-Jul-2015 12:48:16 Europe/Paris] PHP Notice: Undefined index: in /Applications/MAMP/htdocs/uta/system/library/Translation.php on line 371
[23-Jul-2015 12:48:16 Europe/Paris] PHP Notice: Undefined index: in /Applications/MAMP/htdocs/uta/system/library/Translation.php on line 371
$config->set('config_language_id', $languages[$code]['language_id']);
$config->set('config_admin_language', $languages[$code]['code']);
$config->set('config_language_default', $languages['fr']['language_id']);
// Language
$language = new Language($languages[$config->get('config_admin_language')] ['directory']);
$language->load($languages[$config->get('config_admin_language')]['filename']);
$registry->set('language', $language);
private function loadFile($language_id, $filename)
{
$code = $this->languages[$language_id]['code'];
$file = $this->lang_root . $code . '/' . $filename . $this->file_ext;
if (file_exists($file)) {
$_lang = array();
include $file;
$this->translations[$filename][$language_id] = $_lang;
} else {
$this->translations[$filename][$language_id] = array();
}
}
虽然我很确定我的2个config.php配置正确,如果不对,php log会给我一些错误,我假设。
那么有没有人可以给我一个关于这个通知意味着什么的提示?以及如何让/ admin运作良好。 提前谢谢。
error_log(var_export($ languages,true))告诉我:
array (
'en' =>
array (
'language_id' => '1',
'name' => 'English',
'code' => 'en',
'locale' => 'en_US.UTF-8,en_US,en-gb,english',
'image' => 'gb.png',
'directory' => 'english',
'filename' => 'startup',
'sort_order' => '1',
'status' => '1',
),
'fr' =>
array (
'language_id' => '2',
'name' => 'Français',
'code' => 'fr',
'locale' => 'fr_CA.UTF-8,fr_FR.UTF-8,fr_CA,fr_FR,fr-fr,french',
'image' => 'fr.png',
'directory' => 'french',
'filename' => 'startup',
'sort_order' => '0',
'status' => '1',
),
'ru' =>
array (
'language_id' => '3',
'name' => 'Russian',
'code' => 'ru',
'locale' => 'ru,ru_RU,ru_RU.UTF-8',
'image' => 'ru.png',
'directory' => 'russian',
'filename' => 'startup',
'sort_order' => '2',
'status' => '1',
),
)
error_log(var_export($ this-> languages,true))告诉我:
array (
1 =>
array (
'code' => 'en',
'name' => 'English',
'img' => 'gb.png',
'id' => '1',
),
2 =>
array (
'code' => 'fr',
'name' => 'Français',
'img' => 'fr.png',
'id' => '2',
),
3 =>
array (
'code' => 'ru',
'name' => 'Russian',
'img' => 'ru.png',
'id' => '3',
),
)
答案 0 :(得分:0)
最后解决了问题,似乎是由于一些cookie和会话问题。