Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Get useful error messages in PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 151
    Comment on it

    In case of syntax errors all you need to do to is to turn on error display in the php.ini. You may miss it because of it being turned off by default. Well, they are turned off by default because of a simple reason that a customer does not come across the error messages.
    If you want information on the 2 directives: error_reporting and display_errors, then please check this page in the PHP documentation. You may like to go ahead with changing display_errors. In case, you are facing hassles in modifying the php.ini, adding following lines to an .htaccess file will provide you the fix with ease.

    php_flag  display_errors        on
    php_value error_reporting       2039
    

    The error log file contains all the errors (unless logging has been disabled), so checking it could prove to be a great help.
    (2) Errors that are not syntax errors could be easily debugged by adding the following 2 lines:

    error_reporting(-1);
    ini_set('display_errors', 'On');
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: