1

First of all, my web return blank white screen,after add error_reporting(E_ALL); to index.php the error is appear :

A PHP Error was encountered

Severity: Notice

Message: Only variable references should be returned by reference

Filename: core/Common.php

Line Number: 257

then, using this suggestion, i change system/core/common.php file on line 257. But After change it, my web comeback to blank screen.

Please help me to solve this...

FYI, my index.php :

define('ENVIRONMENT', 'production');

if (defined('ENVIRONMENT'))
{
    switch (ENVIRONMENT)
    {
        case 'development':
            error_reporting(E_ALL);
            ini_set('display_errors', 1);
        break;

        case 'testing':
        case 'production':
            error_reporting(E_ALL);

        break;

        default:
            exit('The application environment is not set correctly.');
    }
}

I have tried to change ENVIRONMENT to development, but still face blank screen...

Community
  • 1
  • 1
zukijuki
  • 2,053
  • 3
  • 36
  • 87
  • this is because version problem in some case. Actually the error is not happened in that particular file – Adarsh M Pallickal Dec 28 '15 at 05:29
  • @AdarshMPallickal is it possible to downgrade php when using XAMPP ? – zukijuki Dec 28 '15 at 05:31
  • set display_errors=1 in your php.ini... something else must be happening. – Clay Dec 28 '15 at 05:54
  • @Clayton i just change to display_erros=1 or display_errors=On, but no change... – zukijuki Dec 28 '15 at 06:07
  • are you echo'ing any values? Is that literally everything in your index.php? maybe it's not displaying anything because you have nothing to display? post more code... – Clay Dec 28 '15 at 06:09
  • @Clayton i'm not doing echo and too many codes to display here, however this code on my server run smoothly, only on local computer i face this error.... – zukijuki Dec 28 '15 at 06:11
  • is your database username/password configured correctly? if you view the source of the 'blank' screen do you see anything? – Clay Dec 28 '15 at 06:12
  • @Clayton database still have same configuration to my server, but it should show any error, right ? – zukijuki Dec 28 '15 at 06:14
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/99094/discussion-between-clayton-and-user2226388). – Clay Dec 28 '15 at 06:15

4 Answers4

1

Try this. But instead doing this you should change your ENVIRONMENT Constant as your requirement. If you want to show error change define('ENVIRONMENT', 'production'); to define('ENVIRONMENT', 'development');

switch (ENVIRONMENT)
{
    case 'development':
        error_reporting(-1);
        ini_set('display_errors', 1);
    break;

    case 'testing':
    case 'production':
        error_reporting(-1);
        ini_set('display_errors', 1);
    break;

    default:
        exit('The application environment is not set correctly.');
}
Vinie
  • 2,910
  • 1
  • 14
  • 29
0

Try this

Edit filename: core/Common.php, line number: 257

Before

return $_config[0] =& $config; 

After

$_config[0] =& $config;
return $_config[0]; 
Adarsh M Pallickal
  • 813
  • 3
  • 16
  • 37
0

I have undergone similar issue and modified the 257th line of system/core/common.php. if it is not mentioned as below change it so-

$_config[0] =& $config;
return $_config[0]; 

Only variable references should be returned by reference - Codeigniter

Codeigniter displays a blank page instead of error messages

Community
  • 1
  • 1
Sanjuktha
  • 1,035
  • 3
  • 13
  • 24
0

This is default settings of Codeigniter. Keep it has it is.

if (defined('ENVIRONMENT'))
{
    switch (ENVIRONMENT)
    {
        case 'development':
            error_reporting(E_ALL);
        break;

        case 'testing':
        case 'production':
            error_reporting(0);
        break;

        default:
            exit('The application environment is not set correctly.');
    }
}

Just you have to do is, in define('ENVIRONMENT', 'XYZ'); you can change environment with your purpose.

  1. development - Shows errors of your system and suit for developers
  2. testing - This is for testing purpose
  3. production - This is when site is live/hosted. So no errors will appear in view. Just skip all and run smoothly.

When error_reporting(E_ALL); is there you no need to set ini_set('display_errors', 1);. Bcz its shows the all errors as well.

Hence in production do not set error_reporting(E_ALL);. Bcz production is used to when site is hosted.

Abdulla Nilam
  • 29,776
  • 14
  • 53
  • 77
  • Hi, it still not work, i just download fresh package from server then just change index.php parameter, but still face error... – zukijuki Dec 28 '15 at 10:31
  • `define('ENVIRONMENT', 'production');` to `define('ENVIRONMENT', 'development');` only change this.... – zukijuki Dec 28 '15 at 12:29
  • as i said before in my asking, an error then blank screen, please see my question... – zukijuki Dec 28 '15 at 22:31