Dealing with multiple error_log files?

1linweb

Registered
Sep 21, 2014
3
0
1
cPanel Access Level
Root Administrator
Currently error_log files are generated in the same directory as the PHP script that generated the errors.

What do I need to change so that all errors are placed in a single error_log file in each accounts public_html folder?

Also, I am trying to put together a list of the most effective SSH commands for dealing with error_log files e.g.

- delete all error_log files - find /home -name error_log -exec rm -f {} \;
- listing all error_log files - find /home -name error_log
- listing the size of all error_log files - find /home -name error_log -exec stat -c%s {} \;
- listing all error_log files ascending by size - ?

If anyone has any other examples to add I would appreciate it very much.

Thank you.
 

1linweb

Registered
Sep 21, 2014
3
0
1
cPanel Access Level
Root Administrator
I forgot to add that I'm running Apache 2.4, PHP 5.4, SuPHP

Since I'm using SuPHP, is the only way to get all errors placed in a single error_log file in each accounts public_html folder by adding a php.ini file to every account?

How would I automate copying the default php.ini from /usr/local/lib/php.ini to /home/$user/php.ini during account creation, with the error_log directive modified? Can anyone provide me with an example of using the skeleton directory and/or postwwacct for this purpose?

A few more SSH comands for dealing with error_log files to add to this thread:
remove all error_log files over 10MB - find /home/ -size +10000k -name error_log -exec rm -rf {} \;
find large error_log files over 10MB - find /home -type f -size +10000k -name "error_log"
list size and location of all error_log files - find /home -type f -name "error_log" -print0 | xargs -0 du -sh

Thank you,
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,243
463
Hello :)

Yes, with suPHP, you can configure individual PHP options by placing a php.ini file within the account. The "Skeleton Directory" functionality is documented here:

Skeleton Directory

Thank you.