Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Dealing with multiple error_log files?

Discussion in 'General Discussion' started by 1linweb, Sep 21, 2014.

  1. 1linweb

    1linweb Registered

    Joined:
    Sep 21, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    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.
     
  2. 1linweb

    1linweb Registered

    Joined:
    Sep 21, 2014
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    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,
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,344
    Likes Received:
    1,854
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice