• In Chat
  • About
  • Contact
  • Browse

    Latest Coding

    Latest Daily

    Latest Health

    Featured Story

Coding 2018

| Begin | File Bank |  Register | Reply | Search | Statistics | Manual |
Local Coding / Local /  
 

Disabling scripts from writing to php error log

 
Author Admin
Admin


#1 | Posted: 5 Oct 2018 06:52 
The php error log can grow to an enormous size. This could be problematical on a server with limited hard drive space. A server of mine ground to a halt one day when all hard drive space had been used up by the error logs. How to disable writing to such logs?

1. By altering the vhost file for a particular domain.
(you should see a reference to the php error log. To disable it all you do is comment out the line)

2. By placing the code below in the problematical scripts with php tags

// Turn off all error reporting in logs
error_reporting(0);

When I checked the log size on the server being used to run this site I could see a major problem even though there is a great deal of hard drive space on this particular server (MAMP server). To work out what scripts were the main culprits I deleted the php error log at first. The server then created a clean error log. I then opened the php error log in TextWrangler which auto-updates. On opening each page of my site I could then easily see where the errors were coming from and the reasons for them. Mainly there were warnings of undefined variables. A right pain to correct but no-doubt I will work my way through the scripts in time. All the script pages where excessive errors were finding their way to the php error log file had the above code added right at the very top. Now I have a fairly clean php error log which I can refer to when needed.
Website Designer

Your Reply Click this icon to move up to the quoted message


 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.

 

 
Coding Powered by Forum Software miniBB ®
Online now: Guests - 1
Members - 0
Max. ever online: 4 [14 Oct 2018 12:43]
Guests - 2 / Members - 2
No Of Posts

  • Latest Daily Post ...

  • Latest Health Post ...

CONTACT

Phone: +01 0775 8107 427

sport4u2018@gmail.com

WEBMASTER

email icon Mark Jones

Latest Story

RANDOM CODING

  • Copyright © 2018 MKJ Brainwaving
↑ TOP