Php.log: what is the way to clear the log file?

I was looking for a php log file that expanded too quickly and used up a lot of disk space.

What is the best way to clean a log file?

Is it a problem to simply delete the log file? And will this log file be recreated as PHP tries to write it?

+6
source share
4 answers

It is completely safe to simply delete the php.log file. It will be automatically created the next time you need it.

+12
source

On Linux, you can:

cat /dev/null > /var/logs/php.log   
+4
source

Mac OS X 10.6 /var/log/apache2/error_log. , . apache, . .

+3

, :

  1. Delete the php.log file altogether.
  2. If on Apache restart the server using the command "service apache2 restart"
  3. If on NGINX you do not need to restart the server
0
source

All Articles