0

My CI project doesnt show any error and it is only show HTTP ERROR 500.
I have searched already and done these:

define('ENVIRONMENT', 'development');

    case 'development':
    error_reporting(E_ALL);
    ini_set('display_errors', 'On');
    ini_set("error_reporting","E_ALL & ~E_NOTICE & ~E_STRICT");
    break;

Also tested

ini_set('display_errors', 1);

But nothing changed.
Any help would be apriciated.

Majid Ramzani
  • 358
  • 5
  • 12
  • 1
    Possible duplicate of [How can I make PHP display the error instead of giving me 500 Internal Server Error](https://stackoverflow.com/questions/2687730/how-can-i-make-php-display-the-error-instead-of-giving-me-500-internal-server-er) – Mohammad Oct 06 '18 at 12:08
  • No, that post did not help me!! – Majid Ramzani Oct 06 '18 at 12:11
  • 1
    Have you `switch` that used `case`? – Mohammad Oct 06 '18 at 12:11
  • Yes, that is part of my code. the case is running but the errors are still hidden. – Majid Ramzani Oct 06 '18 at 12:13
  • Have you checked your web servers error log? I would also recommend not to just include a small snippet of your code (like the `case` without showing the `switch` since we won't know if you've missed something or are simply not showing us all the code). – M. Eriksson Oct 06 '18 at 12:16
  • You also don't need to use both `error_reporting()` and `ini_set('error_reporting', ...)` since they set the same setting. – M. Eriksson Oct 06 '18 at 12:17
  • Maybe you can't change ini file content. After using `ini_set()` use `ini_get('display_errors')` to check value of `display_errors` – Mohammad Oct 06 '18 at 12:20
  • used ini_get('display_errors') and it returns "On" , but errors are hidden and error 500 is showing! – Majid Ramzani Oct 06 '18 at 12:24
  • @Majid.r Maybe error is for codes before `ini_set()` – Mohammad Oct 06 '18 at 12:29
  • No , ini_set is in index.php and my code is in some controller. – Majid Ramzani Oct 06 '18 at 12:33

1 Answers1

0

I have encountered this problem before. this problem occurs because I deleted the errors folder inapplication / view codeigniter.

the solution is only to download the folder back on the codeigniter web

  • Thanks, But No! I already have this folder in my prroject. also i have to mention that i only have this problem in my host!, in localhost everthing is ok. – Majid Ramzani Oct 08 '18 at 05:41