3

I have a php website running on lighttpd. I have around 15 to 30k visits daily. Now, in my PHP code, I have a lot of warnings generated by undeclared $_GET or $_POST variables.

Obviously these are not shown to the user so are all logged into lighttpd log tiles.

Problem is: every 3 or 4 days those logs get so big that basically take up all the space in the system and can't do anything else, sessions stop working, etc.

How can I prevent lighttpd from writing up all those warning messages?

john smith
  • 131
  • 2

1 Answers1

3

You coult turn off logging php errors.
See http://www.php.net/manual/en/errorfunc.configuration.php#ini.log-errors

Or you could use some log rotation mechanism to compress each day's log and delete logs that are older than two or three days.
See http://linux.die.net/man/8/logrotate

Cobra_Fast
  • 650
  • 2
  • 8
  • 23
  • I would opt for turning off logging PHP warnings and notices, only errors logged. Logrotate doesn't actually help much on highly trafficated and error-plenty applications, at least if the HD is clogged in 3 or 4 days (I had a site, hit by Google indexer, that clogged the 30GB Azure VHD in 1 hour because of one damn script) – usr-local-ΕΨΗΕΛΩΝ Feb 05 '13 at 14:54