Custom php.ini per vhost (domain) on cPanel

Discussion in 'Install/Configuration' started by twhiting9275, Jul 3, 2014.

  1. twhiting9275

    twhiting9275 New Member

    So, I'm trying to go through and make sense of this documentation here, but having no luck at all.
    LSWS version: 4.2.12
    lsphp5 environment:
    tried
    as well


    Full php5 configuration in image
    Whenever I go to any site on the server though, Scan this dir for additional .ini files is always empty, and it's just a global php.ini file loaded, despite the fact that valid php.ini files exist in separate directories

    Ideas on what could be wrong?

    Attached Files:

  2. mistwang

    mistwang LiteSpeed Staff

    You should remove the double quote.
    You must enable PHP suEXEC under "Server->general->Apache configuration"
    Check phpinfo() page see if the PHPRC environment has been set to the correct value or not.
    twhiting9275 likes this.
  3. twhiting9275

    twhiting9275 New Member

    Like I mentioned, tried with and without the quote. that quote is from your wiki though ;)
    Yup, wasn't disabled
    This is helpful. Turns out $VH_ROOT points to the actual user's homedir (would think that would be VH_USER) (ie: /home/user), not the virtualhost (ie: /home/user/public_html/domain). While this is very useful, it would be better to change this to point to the domain's root. Any thought on how to do this?
  4. mistwang

    mistwang LiteSpeed Staff

    $VH_ROOT is the user's home directory.

    You can use something like

    $VH_ROOT/public_html

    or $VH_ROOT/php

    However, each account can only have one php.ini, so it wont work if you want per subdomain php.ini.
    Licensecart and twhiting9275 like this.
  5. twhiting9275

    twhiting9275 New Member

    That makes sense then. Thank you for your help there. It's a bit different from using public_html/domain/php.ini , but I think it'll make it easier to manage per account php settings to use $VH_ROOT ;)

Share This Page