I just switched hosting services. At my old service, I saw any error messages from PHP at the top of my page (pushing the page down). At my new service, I do not see those messages (making it very difficult to debug!). Is there a setting that I can set in my scripts to get errors reported?

I am not even getting parse errors!

I looked at the ini_set command and set the error_reporting variable to 1, which did not have the desired effect. Then I tried setting it to "ON", which also did not have the desired effect.

Any suggestions?

Thank you,

MelπŸ˜•

    Before using a PHP directive be sure to find it in the PHP manual to see what kind of values it accepts. For error related directives go here:

    http://www.php.net/manual/en/ref.errorfunc.php

    In this case you want E_ALL as it shows all errors. The following two lines of code are IDENTICAL:

    <?php
    ini_set('error_reporting', E_ALL);
    error_reporting(E_ALL);
    ?>
    

    But I'm guessing the above won't [by itself] help and that other directives are at play. Maybe not. Check out the display_errors directive in the above manual page, it needs to be on to output PHP errors to the screen. A call to phpinfo() will share with you your settings but for now also stick a ini_set('display_errors', 1); on top of your file. Your host may be logging the errors (instead of outputting to the screen) and if so you may want to just ask them for the log location.

      By setting both the error_reporting and display_errors variables, I WAS able to see the errors.
      Thank you!
      MelπŸ™‚

        Write a Reply...