APC Uptime Restarts Every 2 Hours

Do you happen to have a really bad uptime for PHP’s APC, and it seems to randomly restart after 2 hours or so?  Well, chances are that you are running cPanel/WHM on this server as well?

The problem is that you need to enable Piped Loggin for Apache.   This can be found under Apache Configuration in WHM.

It says:

Configure Apache to use a single log target for all virtual host access and bandwidth logs. The combined logs will be piped to a helper application where they can be split based upon domain. This option will reduce the number of log files Apache manages freeing up system resources. Piped logging is recommended for systems with a large number of domains. By default this feature is disabled, and Apache will create distinct log files for each virtual host entry.

Once you do this, your log files will be processed (it defaults to every 2 hours), without APC restarting.  For even more information, head over to this post on the cPanel forums.

This problem is obviously very frustrating and it took me quite a while to dig up the solution.  Hopefully this helps others out there.