Remove all error_log & Best error_reporting setting for php


Active Member
Apr 19, 2011
How can i remove all error_log files from the customers public_html (a lot of folders, to many to make this manualy)?

Would this here work and be a good idea?
find /home/ -size +1240k -name error_log -exec rm -rf {} \;
My problem is that the php setting was wrong so customers have very big error_log files (most depreaced notices).

I set the error_reporting now to E_ERROR, what do you think is the best setting?
Last edited:


Staff member
Apr 11, 2011
Hello :)

While that command should work, you may want to run it without the "exec" flag first to get an idea of which files will be deleted. Here is what the php.ini on my test server uses:

error_reporting  =  E_ALL & ~E_NOTICE
This is a full description of what each option outputs:

; error_reporting is a bit-field.  Or each number up to get desired error
; reporting level
; E_ALL             - All errors and warnings
; E_ERROR           - fatal run-time errors
; E_WARNING         - run-time warnings (non-fatal errors)
; E_PARSE           - compile-time parse errors
; E_NOTICE          - run-time notices (these are warnings which often result
;                     from a bug in your code, but it's possible that it was
;                     intentional (e.g., using an uninitialized variable and
;                     relying on the fact it's automatically initialized to an
;                     empty string)
; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
;                     initial startup
; E_COMPILE_ERROR   - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR      - user-generated error message
; E_USER_WARNING    - user-generated warning message
; E_USER_NOTICE     - user-generated notice message
Thank you.