CyberPanel per domain php.ini

Home Forums BulletProof Security Pro CyberPanel per domain php.ini

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #40073
    Ljubomir Manojlovic
    Participant

    Did anybody have any experience with CyberPanel? There is no instructions how to set per domain php.ini and forum is unresponsive.

    Problem is error log path for BPS, as it should to be per domain (WP installation). I know for solution to set in php.ini and use user.ini, but there are also two issues about it:

    • there is also no user.ini per domain
    • I found online suggestion by LST to not use user.ini per domain for some reasons (not relevant here to expose)

    Basically, I need php.ini per domain, but no idea how to set it. Online is available instructions for PHP Per User php.ini in LiteSpeed Web Server (https://docs.litespeedtech.com/cp/cpanel/php-user-ini/), but it is not applicable for CyberPanel.

    #40074
    AITpro Admin
    Keymaster

    First you need to check that php error logging is turned On.  Use P-Security > PHP Info Viewer > click the View PHPINFO button > look for these 2 directives > log_errors and error_log.  log_errors = On means php error logging is turned On. error_log = /path/to/php/error-log-file.log is the path to the php error log file. If a path is set in the server’s default php.ini file then all websites under that hosting account will use that php error log path.

    First have you checked to see if the BPS Pro ini_set Options code is working in your wp-config.php file?

    You can try these things and see what happens.
    Create a new .user.ini file and a new php.ini file and put them in the root of the WordPress site (the WordPress installation folder where the wp-config.php file is located).
    Add these directives in both your new .user.ini file and your new php.ini file.
    log_errors = On
    error_log = /path/to/the/BPS/Pro/php/error/log/file

    #40075
    Ljubomir Manojlovic
    Participant

    Thanks. Great advices. I will try all of that and reply afternoon or tomorrow.

    #40080
    Ljubomir Manojlovic
    Participant

    Interesting. It looks that all works fine as I get out of box /home/mydomain.com/public_html/wp-content/bps-backup/logs/bps_php_error.log

    I’m now just not sure what it mean exactly vs php.ini file. CyberPanel set automatically php.ini file per domain (if so, how I can find the path?) or BPS use server php.ini file (/usr/local/lsws/lsphp74/etc/php/7.4/litespeed/php.ini)?

    #40081
    AITpro Admin
    Keymaster

    I’m not really sure what you are asking.  You cannot alter/edit/modify the default server php.ini file unless you have Administrator access to your host server.  When you create your own custom .user.ini or php.ini files the host server checks for custom .user.ini or php.ini files FIRST and then if the directive values are different in the custom .user.ini or php.ini files it uses the directive settings in the custom files instead of the directive settings in the server’s default php.ini file.

    #40093
    Ljubomir Manojlovic
    Participant

    Sorry for delay, but I needed to get more clear situation and all will end with simple question.

    CyberPanel have structure of domains with child domain within domain. It mean that I have ie WP path as /home/domain.com/public_html and for subdomains as /home/domain.com/public_html/sub.domain.com/.

    Somehow, BPS is installed smoothly without any php changes and warnings in all server instances and do not complain about error logs path. However, I asked CP support about custom php.ini per domain and I get answer ass follow:

    you can add additional php paramters / or override global php values by editing ‘ vHost Conf’ for each domain and add custom PHP values inside the phpinioveride block , like if you need to enable domain based error logs do as following

    phpIniOverride {
    php_admin_value error_log "php_error.log"
    php_admin_value display_errors "on"
    }

    So, my question is about recommendation about what to do:

    1. To let it as it is now.
    2. To set override.
    #40094
    Ljubomir Manojlovic
    Participant

    I forgot to mention, but I think that it is logical (I didn’t asked), that override simply ‘push’ copy of php.ini in installation root folder.

    #40095
    AITpro Admin
    Keymaster

    phpIniOverride { appears to be a host configuration setting that is unique/specific to CyberPanel on OpenLiteSpeed > https://forums.cyberpanel.net/discussion/823/how-to-use-your-php-ini-for-each-domain. All I can tell you is if things are working and if you are ok with how things are working then you don’t need to change anything. If you are not ok with how things are working then I recommend that you post any further questions on the CyberPanel forum site since this is an OpenLiteSpeed/CyberPanel specific thing.

    #40096
    Ljubomir Manojlovic
    Participant

    I’m not ‘crazy’ about perfections. I wrote that BPS is not complain about path (now, at initial stage) and personally, I will be more than OK to not touch anything. I just ask about your opinion (to avoid eventual issues).

    So, I think that topic is closed and solved.

    #40097
    Ljubomir Manojlovic
    Participant

    Yeah, I forgot. BPS for some reasons will not be set if previously I will not manually enable “Enable|Disable htaccess Files:”. However, after that all pass without any complain by BPS.

    Should I be worried about it?

    #40098
    AITpro Admin
    Keymaster

    Nothing to worry about.  A few people have run into the issue where the BPS Apache Module checking code incorrectly determines that a site cannot use htaccess files and sets htaccess files to disabled.  I have not been able to reproduce the problem and have checked the Apache Module checking code and cannot find where the issue might be occurring.  So yeah you would just enable htaccess files on the Setup Wizard Options page if the BPS Apache Modules checking code incorrectly determines that your site cannot use htaccess files.

    #40099
    Ljubomir Manojlovic
    Participant

    Thanks. Solved and closed.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.