error_log file in every directory?

nurseryboy

Well-Known Member
Mar 3, 2003
78
0
156
Any ideas why an error_log file would be created in any directory thats under an account that produces a Apache/PHP/MySQL error? For example, http://www.example.com/mydir/index.php has some PHP errors that display when I try to access the file through the web. In /home/mysite/public_html/mydir, an "error_log" file is created, and all the errors are in it. I don't remember seeing this on previous CPanel servers. What can I do to change this back to the "normal" way of logging?

Thanks,

Matthew
 

mctDarren

Well-Known Member
Jan 6, 2004
665
4
168
New Jersey
cPanel Access Level
Root Administrator
What's the normal way of logging you are familiar with? In php.ini you can control logging and error display. Look for the "Error handling and and logging" section. Most people these days (well they should anyway) leave display_errors as off and turn on log_errors. This is what you'll find yours is set to probably.

Reason being, it doesn't show the error to people who are trying to find bad php scripts to exploit. If they don't see an error, it's harder for them to exploit it. :)

Anyway, if you want to change those values then simply save the file and restart apache. You will be good to go.
 

nurseryboy

Well-Known Member
Mar 3, 2003
78
0
156
I always thought there was a single file per domain that held the error messages for that domain, rather than an error_log file being created under each directory an error occurs.

I agree with turning the displaying of errors off, but I'd like to keep logging on so I can see what's going on. I just don't like that a site could have 50 different error_log files throughout the site's public_html directory.

Does that make sense?

Thanks,

Matthew