Access our premium support and let us know your problems, we will help you solve them.

0
No products in the cart.

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: How do I get PHP errors to display? #10180
    blankandre
    Participant

    To display all errors you need to:

    1. Have these lines in the PHP script you’re calling from the browser (typically index.php):

    error_reporting(E_ALL);
    ini_set('display_errors', '1');
    

    2.(a) Make sure that this script has no syntax errors

    —or—

    2.(b) Set display_errors = On in your php.ini

    Otherwise, it can’t even run those 2 lines!

    You can check for syntax errors in your script by running (at the command line):

    php -l index.php
    

    If you include the script from another PHP script then it will display syntax errors in the included script. For example:

    index.php

    error_reporting(E_ALL);
    ini_set('display_errors', '1');
    
    // Any syntax errors here will result in a blank screen in the browser
    
    include 'my_script.php';
    

    my_script.php

    adjfkj // This syntax error will be displayed in the browser
    
Viewing 1 post (of 1 total)