CyberHosting

how to use your php.ini for each domain?

edited October 2018 in Web Server
how to use your php.ini for each domain?
Tagged:
Tagged:

Comments

  • For CyberPanel Ent, you can use custom php.ini the similar way as Apache. For OpenLiteSpeed you can use phpIniOverride, such as
    phpIniOverride  {
    php_value display_errors "Off"
    php_value upload_max_filesize "200M"
    php_value post_max_size "250M"
    }
    You can put this in vHost conf of your website/child-domain.
  • For CyberPanel Ent, you can use custom php.ini the similar way as Apache. For OpenLiteSpeed you can use phpIniOverride, such as

    phpIniOverride  {
    php_value display_errors "Off"
    php_value upload_max_filesize "200M"
    php_value post_max_size "250M"
    }
    You can put this in vHost conf of your website/child-domain.
    Great thanks
  • Please tell me how to enable the Directive short_open_tag on a specific domain via vHost conf?
  • Adding php_value short_open_tag=On to vHost conf does not produce the same results as its other variants
  • Make sure your vHost conf for OpenLiteSpeed looks like
    docRoot                   $VH_ROOT/public_html
    vhDomain $VH_NAME
    vhAliases www.$VH_NAME
    adminEmails [email protected]
    enableGzip 1
    enableIpGeo 1

    index {
    useServer 0
    indexFiles index.php, index.html
    }

    errorlog $VH_ROOT/logs/$VH_NAME.error_log {
    useServer 0
    logLevel ERROR
    rollingSize 10M
    }

    accesslog $VH_ROOT/logs/$VH_NAME.access_log {
    useServer 0
    logFormat "%v %h %l %u %t "%r" %>s %b"
    logHeaders 5
    rollingSize 10M
    keepDays 10 compressArchive 1
    }

    scripthandler {
    add lsapi:talksho php
    }

    extprocessor talksho {
    type lsapi
    address UDS://tmp/lshttpd/talksho.sock
    maxConns 10
    env LSAPI_CHILDREN=10
    initTimeout 600
    retryTimeout 0
    persistConn 1
    pcKeepAliveTimeout 1
    respBuffer 0
    autoStart 1
    path /usr/local/lsws/lsphp71/bin/lsphp
    extUser talksho
    extGroup talksho
    memSoftLimit 2047M
    memHardLimit 2047M
    procSoftLimit 400
    procHardLimit 500
    }
    context /.filemanager {
    location /usr/local/lsws/Example/html/FileManager
    allowBrowse 1
    autoIndex 1

    accessControl {
    allow 127.0.0.1, localhost
    deny 0.0.0.0/0
    }
    rewrite {
    inherit 0

    }
    phpIniOverride {
    php_value display_errors "Off"
    php_value upload_max_filesize "200M"
    php_value post_max_size "250M"
    }
    addDefaultCharset off
    }
    phpIniOverride {
    php_value short_open_tag 1
    }

    rewrite {
    enable 1
    autoLoadHtaccess 1
    }
  • Make sure your vHost conf for OpenLiteSpeed looks like

    docRoot                   $VH_ROOT/public_html
    vhDomain $VH_NAME
    vhAliases www.$VH_NAME
    adminEmails [email protected]
    enableGzip 1
    enableIpGeo 1

    index {
    useServer 0
    indexFiles index.php, index.html
    }

    errorlog $VH_ROOT/logs/$VH_NAME.error_log {
    useServer 0
    logLevel ERROR
    rollingSize 10M
    }

    accesslog $VH_ROOT/logs/$VH_NAME.access_log {
    useServer 0
    logFormat "%v %h %l %u %t "%r" %>s %b"
    logHeaders 5
    rollingSize 10M
    keepDays 10 compressArchive 1
    }

    scripthandler {
    add lsapi:talksho php
    }

    extprocessor talksho {
    type lsapi
    address UDS://tmp/lshttpd/talksho.sock
    maxConns 10
    env LSAPI_CHILDREN=10
    initTimeout 600
    retryTimeout 0
    persistConn 1
    pcKeepAliveTimeout 1
    respBuffer 0
    autoStart 1
    path /usr/local/lsws/lsphp71/bin/lsphp
    extUser talksho
    extGroup talksho
    memSoftLimit 2047M
    memHardLimit 2047M
    procSoftLimit 400
    procHardLimit 500
    }
    context /.filemanager {
    location /usr/local/lsws/Example/html/FileManager
    allowBrowse 1
    autoIndex 1

    accessControl {
    allow 127.0.0.1, localhost
    deny 0.0.0.0/0
    }
    rewrite {
    inherit 0

    }
    phpIniOverride {
    php_value display_errors "Off"
    php_value upload_max_filesize "200M"
    php_value post_max_size "250M"
    }
    addDefaultCharset off
    }
    phpIniOverride {
    php_value short_open_tag 1
    }

    rewrite {
    enable 1
    autoLoadHtaccess 1
    }
    The greatest thanks!
    Now works great
  • edited July 5
    writemyessaytoday said:
    Adding php_value short_open_tag=On to vHost conf does not produce the same results as its other variants
    When I go to Server > PHP > Edit PHP Configs, I cannot do basic editing for each php version. I wanted to do advance configurations, but when I restart the Litespeed, nothing is changed. What can be the issue?

  • Try add this

    PHPRC=/home/domain.com/public_html

    in ext app env , like so:

    https://i.imgur.com/7e3ULa0.png



    then copy everything in /usr/local/lsws/lsphpXX/etc/php.ini into /public_html/php.ini

    after that , customize your values in public_html/php.ini

    https://i.imgur.com/03jG516.png
Sign In or Register to comment.
CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!