Thread: No errors?

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    8
    Rep Power
    0

    No errors?


    Hello DevShed. I had a quick question that google doesn't seem to answer for me. I am trying to run this script:

    Code:
    <?php
    require("noFileExistsHere.php");
    echo "Hi Earth :)";
    ?>
    In order to produce an error. However, instead I get no error whatsoever. No output of any kind in fact. I have definitely made sure to enable error reporting in /etc/php/php.ini..

    Code:
     display_errors
       Default Value: On
       Development Value: On
       Production Value: On
    
     display_startup_errors
       Default Value: On
       Development Value: On
       Production Value: On
    
     error_reporting
       error_reporting E_ERROR  E_WARNING  E_PARSE
       Default Value: E_ALL E_NOTICE E_STRICT E_DEPRECATED
       Development Value: E_ALL
       Production Value: E_ALL E_DEPRECATED E_STRICT
    
     html_errors
       Default Value: On
       Development Value: On
       Production value: On
    
     log_errors
       Default Value: On
       Development Value: On
       Production Value: On
    To no avail. Any ideas?
  2. #2
  3. Web Developer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2006
    Posts
    480
    Rep Power
    113
    Try enabling error reporting on top of the script:

    PHP Code:
    ini_set ('display_errors'true);
    error_reporting (E_ALL); 
    I will try my best !!!
  4. #3
  5. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,316
    Rep Power
    7170
    The lines you posted from your /etc/php/php.ini are supposed to be comments. Is that literally what you have in there? (If so, PHP will fail to parse it correctly)

    On a development machine that section should look like this:
    Code:
    ; display_errors
    ;   Default Value: On
    ;   Development Value: On
    ;   Production Value: Off
    display_errors = On
    
    ; display_startup_errors
    ;   Default Value: Off
    ;   Development Value: On
    ;   Production Value: Off
    display_startup_errors = On
    
    ; error_reporting
    ;   Default Value: E_ALL & ~E_NOTICE
    ;   Development Value: E_ALL | E_STRICT
    ;   Production Value: E_ALL & ~E_DEPRECATED
    error_reporting = E_ALL | E_STRICT
    
    ; html_errors
    ;   Default Value: On
    ;   Development Value: On
    ;   Production value: Off
    html_errors = On
    
    ; log_errors
    ;   Default Value: Off
    ;   Development Value: On
    ;   Production Value: On
    log_errors = On
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    8
    Rep Power
    0
    Originally Posted by web_developer
    Try enabling error reporting on top of the script:

    PHP Code:
    ini_set ('display_errors'true);
    error_reporting (E_ALL); 
    That worked. However, now it causes an error for this script:

    Code:
    <?php
    mysql_connect("localhost", "root", "mypass") or die(mysql_error());
    echo "Connected to MySQL!!!<br />";
    mysql_select_db("data") or die(mysql_error());
    echo "Connected to Database!!";
    ?>
    When this script previously produced the proper output. When I view this page without errors enabled it shows me the proper output, but when I enable errors it makes it so that instead of showing: "Connected to Database!!" it shows me this:

    Code:
     Fatal error: Call to undefined function mysql_connect() in /home/user/code/php/connect.php on line 2
    Is there some other configuration that I have messed up somewhere? Oh, and yes I have restarted the http daemon.

IMN logo majestic logo threadwatch logo seochat tools logo