Alexander Farber
2012-Jun-05 13:57 UTC
[CentOS] How to rotate PHP error log - since it belongs to apache
Hello, I'm using CentOS 6.2 with the stock rpm php-5.3.3-3.el6_2.8.x86_64 and the following /etc/php.ini file: error_reporting = E_ALL & ~E_DEPRECATED display_errors = Off error_log = /var/log/php/php_errors.log and that file is very useful for me because I have many custom PHP-scripts at my site, but that file keeps growing too... :-) So my question is for how to rotate it (esp. since it should be owned by "apache" user) - what do you guys use? Regards Alex
Luigi Rosa
2012-Jun-05 14:04 UTC
[CentOS] How to rotate PHP error log - since it belongs to apache
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Alexander Farber said the following on 05/06/12 15:57:> So my question is for how to rotate it (esp. since it should be owned by > "apache" user) - what do you guys use?the standard logrotate config /etc/logrotate.d/httpd or a modified copy of it since the rotation moves the old log and then reloads Apache, you don't have to worry about the ownership issue Ciao, luigi - -- / +--[Luigi Rosa]-- \ First Law of Socio-Genetics: Celibacy is not hereditary. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk/OEeAACgkQ3kWu7Tfl6ZR5xACdGmRGc9sSBZVRiZy1pzuTBVv/ qsEAoKR1NfYc7lYMhtIwuYEtZd+0Rlfk =jRtF -----END PGP SIGNATURE-----