#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Location
    Iran
    Posts
    148
    Rep Power
    139

    Question What are the required options in php.ini to be able to print errors and warnings?


    Hello everyone


    OS: Fedora Core 17 (x86_64)
    Browser: Firefox 18.0
    PHP version: 5.4.11
    Apache version: 2.2.22


    I would like to know whether it is possible to print different kinds of PHP errors (at least parsing errors) on the browser screen. for example
    Code:
    <?php
        myVariable = 12
    ?>
    This should give a syntax/parse error because there is not $ before the variable name nor the ";" at the end of the statement.

    I modified the file /etc/php.ini by removing comments for the two following options:
    Code:
    . . .
    display_errors=On
    ;   Default Value: On
    ;   Development Value: On
    ;   Production Value: Off
    
    ; display_startup_errors
    ;   Default Value: Off
    ;   Development Value: On
    ;   Production Value: Off
    
    error_reporting=E_ALL
    ;   Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
    ;   Development Value: E_ALL
    ;   Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
    . . .
    Then I restarted the apache service
    Code:
    # service httpd restart
    Yet, I don't see any change, and whenever there is an error, I just have a blank page in the browser.

    Any idea? What are the further actions to be taken in order to print errors and warnings on the screen? (Of course, I want to do this only for development/training purpose, here we are not talking about a production environment)


    Thanks in advance,

    Regards,
    Dariyoosh
    Last edited by dariyoosh; February 18th, 2013 at 04:06 AM.
  2. #2
  3. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,749
    Rep Power
    9397
    Are you sure you edited the right part of the php.ini? There's a big comment block at the top explaining a variety of settings, but the settings themselves are actually further down in the file.

    Comments on this post

    • dariyoosh agrees : Thanks!
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Location
    Iran
    Posts
    148
    Rep Power
    139
    Originally Posted by requinix
    Are you sure you edited the right part of the php.ini? There's a big comment block at the top explaining a variety of settings, but the settings themselves are actually further down in the file.
    Thanks a lot for this remark. Well, it seems that I made a mistake. I edited the file using vim and when I saw
    Code:
    ; display_errors=
    I thought this was the line to modify and uncomment, but in fact that was just the description section in the quick Reference. The actual line was further down.

    Sorry for my mistake, it works now!

    Many thanks for your help and for your time.



    Regards,
    Dariyoosh
    Last edited by dariyoosh; February 18th, 2013 at 04:04 AM.

IMN logo majestic logo threadwatch logo seochat tools logo