3

I know this has been asked multiple times in the past but none of the solutions worked for me.

This is my PHP code:

<?php
  function
?>

This should produce an error. However, it's just returning a 500 error and not loading.

I tried less severe error producing code like this:

<?php
  $test = $example;
?>

Calling on an undefined variable produced an error on a different computer.

In my php.ini, I have display_errors = On, display_startup_errors = On, and error_reporting = E_ALL.

Edit Thanks to aspiringCodingArtisan's suggestion, I realized I was editing the wrong php.ini file. Problem solved.

UserIsCorrupt
  • 4,837
  • 15
  • 38
  • 41
  • 3
    If you check in your server logs, you'll see the error in detail there. – elclanrs Sep 19 '13 at 00:36
  • Is your error-producing `function` in your code, intentional in order to see the errors? And have you tried `error_reporting(E_ALL);` having `E_ALL` inside parentheses instead of `error_reporting = E_ALL` and `ini_set('display_errors',1);` ? – Funk Forty Niner Sep 19 '13 at 00:39
  • @Fred-ii- That's in their `php.ini` file so the `prop = value` syntax is correct – Phil Sep 19 '13 at 00:45
  • @Phil Ok, I thought that in not having `E_ALL` without parentheses would be invalid. – Funk Forty Niner Sep 19 '13 at 00:47
  • Create a `` file and check everything there. Check what values are set for `error_reporting` and `display_errors` as well as the location of your `php.ini` file and any other config files that may have been loaded. Duplicate properties will take the latter value so your settings may be getting overwritten. – Phil Sep 19 '13 at 00:47
  • What does `var_dump(ini_get('display_errors'));` output? Also make sure you're editing the correct `php.ini` file. You can check the location with ``. – Amal Murali Sep 19 '13 at 00:53
  • 1
    Are you looking at the correct `php.ini` file? If you have something like `MAMP` you will find that it has multiple versions of PHP. – kaizenCoder Sep 19 '13 at 00:57
  • This question appears to be off-topic because the OP solved it already – Phil Sep 19 '13 at 01:57
  • @Phil: That doesn't mean it's off-topic; instead, it means they should post an answer with their solution and accept it. – icktoofay Sep 19 '13 at 02:25

1 Answers1

1

Are you looking at the correct php.ini file? If you have something like MAMP you will find that it has multiple versions of PHP.

kaizenCoder
  • 2,211
  • 6
  • 33
  • 64