SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2005
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php-errors.log - Is There Anyway I Can Restrict The File Size?

    Good Afternoon All

    Our php-errors.log file is creating an extremely large file on a new windows 2008 server running IIS7.

    We are going to go through and correct all of the errors, but in the meantime, is there a way that I can restrict the file size?

    I've looked at http://php.net/manual/en/errorfunc.configuration.php but this didn't seem to offer an answer.

    Thank you in advance for any help

    Didcot84
    Last edited by didcot84; May 10, 2012 at 08:45. Reason: Typo

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,162
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2005
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thankyou for replying so quickly cpradio

    Something seems to be not quite right here.

    My php.ini file configuration is the default

    log_errors_max_len = 1024

    But the log_errors file size is well over 1024 bytes?

    Thats why I didn't think that this was the solution. Would there be another configuration overiding this?

  4. #4
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,162
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Well, it seems you and I both get to learn something new today. From StackOverflow, that setting only affects the max length for a single log entry, not the size of the error log. Why you would need 1 KB (the default) for a single log entry is beyond me.

    Looks like you can use this log rotation tool in combination with 7-zip's command line utility to control your logs (granted you will need to edit it to point to the PHP logs instead of apache.

  5. #5
    SitePoint Zealot
    Join Date
    Jun 2005
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much again cpradio

    I will look into this and let you know the result

    Thanks again, have a good evening

  6. #6
    SitePoint Zealot
    Join Date
    Jun 2005
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm just leaving the office, but can I just confirm this script will work with a windows server?

  7. #7
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,162
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    From what I understand the script I linked to was designed for a windows server

  8. #8
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,840
    Mentioned
    73 Post(s)
    Tagged
    6 Thread(s)
    Play about with these file name settings:

    PHP Code:

      define
    ('APPPATH''where_ever_is_best');

      
    ini_set('error_log'APPPATH .'php_error_' .date('Y-m-d-h-m') .'.log');

      echo 
    ini_get('error_log'); 
      
    # where_ever_is_best//php_error_2012-05-11-06-05.log
      
      
    die; 
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Patche on earning Member of the Month for July 2014

  9. #9
    SitePoint Zealot
    Join Date
    Jun 2005
    Posts
    102
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello John-Betong

    I'll play around with both of these ideas, thanks for all of your help, I appreciate you both taking the time and responding so quickly.


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
  •