zh-snail 发表于 2011-3-24 00:29:36

欲哭无泪啊!高手帮帮忙,我实在没辙了

我用codelgniter做了一个网站,上传到租用的虚拟空间上,平时没什么问题,但有时就会报下面这个错误,
实在想不出问题在哪里!只能请各位高人指点一下,是我代码的问题吗?还是服务器的问题?:'(
Notice: Constant EXT already defined in
D:\freehost\jeff2010\web\index.php
on line
88

Notice: Constant SELF already defined in
D:\freehost\jeff2010\web\index.php
on line
89

Notice: Constant FCPATH already defined in
D:\freehost\jeff2010\web\index.php
on line
90

Notice: Constant BASEPATH already defined in
D:\freehost\jeff2010\web\index.php
on line
91

Notice: Constant APPPATH already defined in
D:\freehost\jeff2010\web\index.php
on line
104

Notice: Constant CI_VERSION already defined in
D:\freehost\jeff2010\web\system\codeigniter\CodeIgniter.php
on line
31

Notice: Constant FILE_READ_MODE already defined in
D:\freehost\jeff2010\web\system\application\config\constants.php
on line
16

Notice: Constant FILE_WRITE_MODE already defined in
D:\freehost\jeff2010\web\system\application\config\constants.php
on line
17

Notice: Constant DIR_READ_MODE already defined in
D:\freehost\jeff2010\web\system\application\config\constants.php
on line
18

Notice: Constant DIR_WRITE_MODE already defined in
D:\freehost\jeff2010\web\system\application\config\constants.php
on line
19

Notice: Constant FOPEN_READ already defined in
D:\freehost\jeff2010\web\system\application\config\constants.php
on line
30

Notice: Constant FOPEN_READ_WRITE already defined in
D:\freehost\jeff2010\web\system\application\config\constants.php
on line
31

Notice: Constant FOPEN_WRITE_CREATE_DESTRUCTIVE already defined in
D:\freehost\jeff2010\web\system\application\config\constants.php
on line
32

Notice: Constant FOPEN_READ_WRITE_CREATE_DESTRUCTIVE already defined in
D:\freehost\jeff2010\web\system\application\config\constants.php
on line
33

Notice: Constant FOPEN_WRITE_CREATE already defined in
D:\freehost\jeff2010\web\system\application\config\constants.php
on line
34

Notice: Constant FOPEN_READ_WRITE_CREATE already defined in
D:\freehost\jeff2010\web\system\application\config\constants.php
on line
35

Notice: Constant FOPEN_WRITE_CREATE_STRICT already defined in
D:\freehost\jeff2010\web\system\application\config\constants.php
on line
36

Notice: Constant FOPEN_READ_WRITE_CREATE_STRICT already defined in
D:\freehost\jeff2010\web\system\application\config\constants.php
on line
37

Fatal error: Cannot redeclare class CI_Benchmark in
D:\freehost\jeff2010\web\system\libraries\Benchmark.php
on line
30

visvoy 发表于 2011-3-24 09:38:14

代码问题,也不排除是rpwt

as3291363 发表于 2011-3-24 12:18:10

你這個是什麽版本的CI?

zh-snail 发表于 2011-3-24 14:33:06

我用的是1.73版本的CI,
我不知道代码哪里写错了会出现这种问题,能不能写个错误的范例。
这个问题是偶然性发生,平常运行都没事,就不知道啥时突然就不行了!

zqpmoto002 发表于 2011-3-24 17:23:25

交你怎么关系notice级别的错误:
使用CI的时候,如果一个变量没有值,CI就会提示 Undefined,用PHP的开发的人都知道,定义PHP的变量是不需要初始化任何的值,看这notice真烦人,决定关掉它,开始先搜 A PHP Error was encountered 只在error目录中找到error_php.php,不是想要的结果,这文件只是模板,再搜文件名:error_php,在 system/libraies中的Exceptions中发现

   1.   /**
   2.      * Native PHP error handler
   3.      *
   4.      * @accessprivate
   5.      * @param   stringthe error severity
   6.      * @param   stringthe error string
   7.      * @param   stringthe error filepath
   8.      * @param   stringthe error line number
   9.      * @returnstring
10.      */
11.   function show_php_error($severity, $message, $filepath, $line)
12.   {   
13.         $severity = ( ! isset($this->levels[$severity])) ? $severity : $this->levels[$severity];
14.   
15.         $filepath = str_replace("\\", "/", $filepath);
16.         
17.         // For safety reasons we do not show the full file path
18.         if (FALSE !== strpos($filepath, '/'))
19.         {
20.             $x = explode('/', $filepath);
21.             $filepath = $x.'/'.end($x);
22.         }
23.         
24.         if (ob_get_level() > $this->ob_level + 1)
25.         {
26.             ob_end_flush();
27.         }
28.         ob_start();
29.         include(APPPATH.'errors/error_php'.EXT);
30.         $buffer = ob_get_contents();
31.         ob_end_clean();
32.         echo $buffer;
33.   }

找到include(APPPATH.'errors/error_php'.EXT); 这行,把它注释掉,就OK了

fadingyu 发表于 2011-3-29 14:00:51

顶,期望高手来解决

lijun14992560 发表于 2011-3-29 16:10:55

已定义? 咋回事:funk: 关注~~
页: [1]
查看完整版本: 欲哭无泪啊!高手帮帮忙,我实在没辙了