Huge error log files are eating up disk space

Status
Not open for further replies.

arp1445

Member
Messages
47
Reaction score
0
Points
6
Hi,
Huge error log files are eating up my disk space.
Disk Space Usage 1.03 GB / 1 GB
Please help me to find out them.
Please show me their locations so that I can fix them by myself from next time.
username: arpan14
Thank you
 

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
Hi arp1445,

The majority of your space is being used in w3epic's wp-content directory, as there seem to be hundreds of backups in there. ;)

Thank you,
 

arp1445

Member
Messages
47
Reaction score
0
Points
6
I removed the backups, now its 458.11 MB / 1 GB.
Thanks a lot Dead-i :)
 

militar8

New Member
Messages
14
Reaction score
0
Points
1
I have trouble with error logs because they grow very fast, just fed by innumerable warnings and notices, even if my PHP codes work fine. How could I disable these files?
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
Technically if you're receiving warnings and notices, your code is not working fine. It's kind of like a car in that case - it may be driving, but if the check engine light is on, it is not working fine, and something needs to be checked out/fixed to ensure optimal operation :)

That having been said, you can try adding this to the PHP files causing the warnings/notices to appear in your error_logs:

Code:
// Turn off all error reporting
error_reporting(0);

A bit of advise on this however. I would strongly recommend actually fixing the warning/notice instead; PHP has a habit of sometimes changing the way specific functions operate when a later version comes out, and in some cases they actually remove Deprecated functions entirely. A warning now could turn into a full-stop error later if the function is updated during a PHP update.

If you do opt to put the error_reporting(0) in your code, write down or save somewhere what files you did this with - it will hide all errors, including ones that cause the PHP script to stop execution altogether. If a function is changed as mentioned above, you won't see the error until you remove or comment-out the error_reporting line.

See http://php.net/manual/en/function.error-reporting.php for more details; I'm not good with PHP but I think there's a way to have it only show the errors that are actually preventing execution, but all I know personally is how to shut them off entirely (which I don't recommend).
 

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
Has Livewire said, you can disable the warnings and notices BUT it is better to be safe than sorry. PHP and any other (web) programming are like all 'Mr. Perfect', they want you to do things exactly as they say. By hiding the messages, you're ignoring 'Mr. Perfect', the warning could be to do with something really important.
If your code works 100% perfectly no issues apart from the warnings and notices which are nothing special at all then you can suppress warnings and notices by using:
PHP:
error_reporting(E_ERROR | E_PARSE);
error_reporting() is a suppressor function.
Ignoring errors can slow down your script by a lot and can be a bad practice so I would really sort out the warnings and notices regardless if they're important or not. :)
You can post the notices and warnings here so we could try to sort it out, if you want.
 

militar8

New Member
Messages
14
Reaction score
0
Points
1
No, it is fine, thanks. I have managed to fix almost everything... they were uninitialized variables in many documents.
 
Status
Not open for further replies.
Top