SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru
    Join Date
    Sep 2004
    Location
    Provo, UT
    Posts
    858
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Errors are not being recorded in error_log

    I am trying to track down the reason some of my users are reporting a blank white page while trying to view different links on my website. I recently upgraded to PHP 5.3 and I'm using one php.ini file for all my directories. In my php.ini file I think I have everything turned on correctly. But when I goto a page I know has a parse error, even though I see the error on the screen, it is not logging it in the error_log file on the root of my server. Can someone help me understand why?

    ; Besides displaying errors, PHP can also log errors to locations such as a
    ; server-specific log, STDERR, or a location specified by the error_log
    ; directive found below. While errors should not be displayed on productions
    ; servers they should still be monitored and logging is a great way to do that.
    ; Default Value: Off
    ; Development Value: On
    ; Production Value: On
    ; http://php.net/log-errors
    log_errors = On


    ; Set maximum length of log_errors. In error_log information about the source is
    ; added. The default is 1024 and 0 allows to not apply any maximum length at all.
    ; http://php.net/log-errors-max-len
    log_errors = 1024

    ; Log errors to specified file. PHP's default behavior is to leave this value
    ; empty.
    ; http://php.net/error-log
    ; Example:
    error_log = error_log
    ; Log errors to syslog (Event Log on NT, not valid in Windows 95).
    ;error_log = syslog


    Thanks!
    Convert your dollars into silver coins. www.convert2silver.com

  2. #2
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,000
    Mentioned
    101 Post(s)
    Tagged
    0 Thread(s)
    What error reporting level have you got set?

    http://www.php.net/manual/en/errorfunc.constants.php
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  3. #3
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    The directive regarding the location of the log file for a domain can also be set inside the httpd.conf file (using Apache anyway) which will overrule your php.ini file setting AFAICT.

  4. #4
    SitePoint Addict kduv's Avatar
    Join Date
    May 2012
    Location
    Maui, HI
    Posts
    211
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Meh, just set your log file to /dev/null. It will make things interesting.*

    *That was a joke ... please do not do that
    Keith
    Freelance web developer
    http://www.duvalltech.com/

  5. #5
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,807
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    Just tested this script to ensure my error_log was reporting correctly:

    PHP Code:

      
    # set error_log and toggle settings
         
    ini_set('display_errors',0);
         
    ini_set('error_reporting(',0);

      
    # show previous errors in log_file
         
    $error_log ini_get('error_log');
         
    clearstatcache($error_log);
         echo 
    '<pre>';
            echo 
    '<h1>' .$error_log .'</h1>';
            
    highlight_file($error_log);
         echo 
    '</pre>';
      
      
    # force error and stop execution
         
    require 'this-is-a-test-to-see-if-the-errors-are-being-logged.php' .time();
     
      echo 
    'This line should never ever be displayed'


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •