2
A PHP Error was encountered

Severity: Notice

Message: Constant FILE_READ_MODE already defined

Filename: config/constants.php

Line Number: 16

A PHP Error was encountered

Severity: Notice

Message: Constant FILE_WRITE_MODE already defined

Filename: config/constants.php

Line Number: 17

A PHP Error was encountered

Severity: Notice

Message: Constant DIR_READ_MODE already defined

Filename: config/constants.php

Line Number: 18

A PHP Error was encountered

Severity: Notice

Message: Constant DIR_WRITE_MODE already defined

Filename: config/constants.php

Line Number: 19

A PHP Error was encountered

Severity: Notice

Message: Constant FOPEN_READ already defined

Filename: config/constants.php

Line Number: 30

A PHP Error was encountered

Severity: Notice

Message: Constant FOPEN_READ_WRITE already defined

Filename: config/constants.php

Line Number: 31

A PHP Error was encountered

Severity: Notice

Message: Constant FOPEN_WRITE_CREATE_DESTRUCTIVE already defined

Filename: config/constants.php

Line Number: 32

A PHP Error was encountered

Severity: Notice

Message: Constant FOPEN_READ_WRITE_CREATE_DESTRUCTIVE already defined

Filename: config/constants.php

Line Number: 33

A PHP Error was encountered

Severity: Notice

Message: Constant FOPEN_WRITE_CREATE already defined

Filename: config/constants.php

Line Number: 34

A PHP Error was encountered

Severity: Notice

Message: Constant FOPEN_READ_WRITE_CREATE already defined

Filename: config/constants.php

Line Number: 35

A PHP Error was encountered

Severity: Notice

Message: Constant FOPEN_WRITE_CREATE_STRICT already defined

Filename: config/constants.php

Line Number: 36

A PHP Error was encountered

Severity: Notice

Message: Constant FOPEN_READ_WRITE_CREATE_STRICT already defined

Filename: config/constants.php

Line Number: 37

These are the errors.Why is this happening? I have installed a fresh copy of CI ,and have configured my database correctly.Why this happens.what went wrong.After all this errors,the normal welcome page is coming

** My config/constants.php **

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/*
|--------------------------------------------------------------------------
| File and Directory Modes
|--------------------------------------------------------------------------
|
| These prefs are used when checking and setting modes when working
| with the file system.  The defaults are fine on servers with proper
| security, but you may wish (or even need) to change the values in
| certain environments (Apache running a separate process for each
| user, PHP under CGI with Apache suEXEC, etc.).  Octal values should
| always be used to set the mode correctly.
|
*/
define('FILE_READ_MODE', 0644);
define('FILE_WRITE_MODE', 0666);
define('DIR_READ_MODE', 0755);
define('DIR_WRITE_MODE', 0777);

/*
|--------------------------------------------------------------------------
| File Stream Modes
|--------------------------------------------------------------------------
|
| These modes are used when working with fopen()/popen()
|
*/

define('FOPEN_READ',                            'rb');
define('FOPEN_READ_WRITE',                      'r+b');
define('FOPEN_WRITE_CREATE_DESTRUCTIVE',        'wb'); // truncates existing file data, use with care
define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE',   'w+b'); // truncates existing file data, use with care
define('FOPEN_WRITE_CREATE',                    'ab');
define('FOPEN_READ_WRITE_CREATE',               'a+b');
define('FOPEN_WRITE_CREATE_STRICT',             'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT',        'x+b');


/* End of file constants.php */
/* Location: ./application/config/constants.php */

my autoload.php

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| AUTO-LOADER
| -------------------------------------------------------------------
| This file specifies which systems should be loaded by default.
|
| In order to keep the framework as light-weight as possible only the
| absolute minimal resources are loaded by default. For example,
| the database is not connected to automatically since no assumption
| is made regarding whether you intend to use it.  This file lets
| you globally define which systems you would like loaded with every
| request.
|
| -------------------------------------------------------------------
| Instructions
| -------------------------------------------------------------------
|
| These are the things you can load automatically:
|
| 1. Packages
| 2. Libraries
| 3. Helper files
| 4. Custom config files
| 5. Language files
| 6. Models
|
*/

/*
| -------------------------------------------------------------------
|  Auto-load Packges
| -------------------------------------------------------------------
| Prototype:
|
|  $autoload['packages'] = array(APPPATH.'third_party', '/usr/local/shared');
|
*/

$autoload['packages'] = array();


/*
| -------------------------------------------------------------------
|  Auto-load Libraries
| -------------------------------------------------------------------
| These are the classes located in the system/libraries folder
| or in your application/libraries folder.
|
| Prototype:
|
|   $autoload['libraries'] = array('database', 'session', 'xmlrpc');
*/

$autoload['libraries'] = array();


/*
| -------------------------------------------------------------------
|  Auto-load Helper Files
| -------------------------------------------------------------------
| Prototype:
|
|   $autoload['helper'] = array('url', 'file');
*/

$autoload['helper'] = array();


/*
| -------------------------------------------------------------------
|  Auto-load Config files
| -------------------------------------------------------------------
| Prototype:
|
|   $autoload['config'] = array('config1', 'config2');
|
| NOTE: This item is intended for use ONLY if you have created custom
| config files.  Otherwise, leave it blank.
|
*/

$autoload['config'] = array();


/*
| -------------------------------------------------------------------
|  Auto-load Language files
| -------------------------------------------------------------------
| Prototype:
|
|   $autoload['language'] = array('lang1', 'lang2');
|
| NOTE: Do not include the "_lang" part of your file.  For example
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
*/

$autoload['language'] = array();


/*
| -------------------------------------------------------------------
|  Auto-load Models
| -------------------------------------------------------------------
| Prototype:
|
|   $autoload['model'] = array('model1', 'model2');
|
*/

$autoload['model'] = array();


/* End of file autoload.php */
/* Location: ./application/con

fig/autoload.php */

Piya
  • 1,134
  • 4
  • 22
  • 42
  • seems that your constants get defined twice.. try commenting the corresponding lines out in "config/constants.php" – Yami Feb 05 '14 at 11:21
  • This has nothing to do with database, why do you connect such errors with database? Is this happening on localhost server or live server? – Kyslik Feb 05 '14 at 11:26
  • This is happpening in live server – Piya Feb 05 '14 at 11:33
  • This is strange.None of you have ever encountered this error?? – Piya Feb 05 '14 at 11:44
  • 1
    as I wrote comment before, contact your hosting administrator. And please in future do not post whole files full of comments etc guy below (ITConflux) asked only for one line and you posted 116. In some cases it may be helpful but really not in this one. And FYI it is **Notice** you can ignore those errors. I assume you have same problem on localhost but your server has different error_reporting() setting so you can not see it (on localhost). Please try to play around in root/index.php with error_reporting() & ENVIROMENT. – Kyslik Feb 05 '14 at 12:07
  • Did you check your index.php? better you download from web and install again. – Kumar V Feb 05 '14 at 12:09
  • @Kyslik So you mean I may ignore that errors??Even if I ignore,anyway I could stop them from showing? Any exact way to stop the error reporting? – Piya Feb 05 '14 at 12:13
  • [error_reporting()](http://ua2.php.net/manual/en/function.error-reporting.php) modify index.php in root directory. – Kyslik Feb 05 '14 at 12:25
  • Please also note this answer: http://stackoverflow.com/a/2867077/1564365 – Kyslik Feb 05 '14 at 12:32

1 Answers1

0

Can you post your config/autoload.php file code here? I think you have added the config/constants.php in your

$autoload['config'] = array();
Abdullah Ahmed
  • 75
  • 1
  • 13