The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Move error_log from /public_html

Discussion in 'General Discussion' started by Astral God, Oct 30, 2011.

  1. Astral God

    Astral God Well-Known Member

    Joined:
    Sep 27, 2010
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    127.0.0.1
    cPanel Access Level:
    Root Administrator
    Hello.

    I'm setting up a VPS with WHM. I've set up a domain for testing purposes, and my error_log file is published under /public_html.

    How can i move this for this domain and for all future domains to another location ?
    I've found some threads on the forum about this but nobody explains how to proceed...
    I would like to have this file under /home/user, not /home/user/public_html.

    I think it should be changed on "PHP Configuration Editor" in Advanced mode, but what should i insert to configure it as i want ?

    Thanks.
     
    #1 Astral God, Oct 30, 2011
    Last edited: Oct 30, 2011
  2. morissette

    morissette Well-Known Member

    Joined:
    May 24, 2009
    Messages:
    119
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Austin, TX
    cPanel Access Level:
    Root Administrator
    Hey,

    This can be done by editing the error_log parameter in your php.ini file to define the file where you want to log the PHP errors to. For example:

    error_log = /home/username/error_log
     
  3. Astral God

    Astral God Well-Known Member

    Joined:
    Sep 27, 2010
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    127.0.0.1
    cPanel Access Level:
    Root Administrator
    Thanks for the reply.
    but if a specify a /username/, all error_logs will be stored under the SAME username, no?

    What i want is configure this ONE TIME and all current and future accounts will have this file under their own /username/.
     
  4. morissette

    morissette Well-Known Member

    Joined:
    May 24, 2009
    Messages:
    119
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Austin, TX
    cPanel Access Level:
    Root Administrator
    In order to do that you would need to use a custom php.ini for each account this can be done by copying the default php.ini from /usr/local/lib/php.ini to /home/$user/php.ini

    you would then need to setup the account to use that php configuration file instead of the default which can be done by adding the following to your .htaccess file for each account:

    <IfModule mod_suphp.c>
    suPHP_ConfigPath /home/user/public_html
    </IfModule>
     
  5. NixTree

    NixTree Well-Known Member

    Joined:
    Aug 19, 2010
    Messages:
    386
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gods Own Country
    cPanel Access Level:
    Root Administrator
    Hello,

    If you need to automate this process, just use postwwacct cPanel hook script.

    cPanel & WHM Script Hooks

    It will make the life easier and it is a one time process, which can be replicated to another server so easily.

    Thank you,
    Nibin.
     
Loading...

Share This Page