Posts by kess

    Hello guys,

    since some weeks I receive every night the following mail message:


    Contents of /var/log/imscp/imscp-dsk-quota.log:


    I've checked everything I could check, I also found a possible related issue here: https://github.com/perl5-dbi/DBD-mysql/issues/202 but unfortunately without a solution.

    Am I the one facing this problem ?

    Everything is working perfectly as expected on my system, the only issue I have is with that thing.


    The system:

    - Debian 9 x64, i-MSCP 1.5.3-2018120800, Dovecot, php-fpm (7.0 as default), proftpd, MariaDB 10.1

    - Plugins: ClamAV, LetsENcrypt, Mailgraph, Monitorix, OpenDKIM, PhpSwitcher, PostScreen, RoundcubePlugins, ServerDefaultPage, SpamAssassin, WHMCS (all latest versions)


    If you need any further informations, please feel free to ask.

    Thank you,

    bye Kess.

    What you found in your backup folder if you browse it using FTP, is exactly what you need to restore everything when the backup snapshot was taken.

    Generally, using the restore button you find in your web UI.


    If you need something different, or something you want to firfe up using command line, it's up to you to check what's inside the SQL file.


    To conclude, I think the current behaviuor is correct. If someone needs something different he should know what he is doing...

    In file /var/www/imscp/gui/plugins/PhpSwitcher/backend/PhpSwitcher.pm

    Change line 926 from:

    Code
    1. if ( $rs || $stdout !~ /PHP\s+(\d+)\.(\d+)\.(\d+)\s+\(cgi-fcgi\)/ ) {

    to

    Code
    1. if ( $rs || $stdout !~ /PHP\s+(\d+)\.(\d+)\.(\d+)\S*\s+\(cgi-fcgi\)/ ) {

    and change line 948 from:

    Code
    1. if ( $rs || $stdout !~ /PHP\s+(\d+)\.(\d+)\.(\d+)\s+\(fpm-fcgi\)/ ) {

    to

    Code
    1. if ( $rs || $stdout !~ /PHP\s+(\d+)\.(\d+)\.(\d+)\S*\s+\(fpm-fcgi\)/ ) {

    Then install every php version you like with every additional module from sury.org (a lot of guides are available, or if you prefer: https://packages.sury.org/php/README.txt)


    The configuration of PHP 5.6 is as follows:

    Common Settings

    Path to PEAR directory: /usr/share/php

    FastCGI Settings

    Path to binary: /usr/bin/php-cgi5.6

    PHP-FPM Settings

    Path to binary: /usr/sbin/php-fpm5.6

    Path to configuration file: /etc/php/5.6/fpm/php-fpm.conf

    Path to pool directory: /etc/php/5.6/fpm/pool.d


    The configuration of PHP 7.0 is as follows:

    Common Settings

    Path to PEAR directory: /usr/share/php

    FastCGI Settings

    Path to binary: /usr/bin/php-cgi7.0

    PHP-FPM Settings

    Path to binary: /usr/sbin/php-fpm7.0

    Path to configuration file: /etc/php/7.0/fpm/php-fpm.conf

    Path to pool directory: /etc/php/7.0/fpm/pool.d


    The configuration of PHP 7.1 is as follows:

    Common Settings

    Path to PEAR directory: /usr/share/php

    FastCGI Settings

    Path to binary: /usr/bin/php-cgi7.1

    PHP-FPM Settings

    Path to binary: /usr/sbin/php-fpm7.1

    Path to configuration file: /etc/php/7.1/fpm/php-fpm.conf

    Path to pool directory: /etc/php/7.1/fpm/pool.d


    The configuration of PHP 7.2 is as follows:

    Common Settings

    Path to PEAR directory: /usr/share/php

    FastCGI Settings

    Path to binary: /usr/bin/php-cgi7.2

    PHP-FPM Settings

    Path to binary: /usr/sbin/php-fpm7.2

    Path to configuration file: /etc/php/7.2/fpm/php-fpm.conf

    Path to pool directory: /etc/php/7.2/fpm/pool.d


    The configuration of PHP 7.3 is as follows:

    Common Settings

    Path to PEAR directory: /usr/share/php

    FastCGI Settings

    Path to binary: /usr/bin/php-cgi7.3

    PHP-FPM Settings

    Path to binary: /usr/sbin/php-fpm7.3

    Path to configuration file: /etc/php/7.3/fpm/php-fpm.conf

    Path to pool directory: /etc/php/7.3/fpm/pool.d


    Please keep in mind that I only use Debian 9 x64, never tested with other distros.

    Please consider that I only use FPM.

    This is a totally unsupported method, I'm sure Nuxwin won't approve that… He is working on something definitive.


    After doing that, you also need to stop the original PHP FPM daemons and also disable them. PHP 7.0 is there only as demo. Debian 9 comes with its original 7.0 version, so I also kept 7.0 as my default PHP version.


    And the result:

    psw.png


    Hope it helps, don't ask for support on that...

    Why don't you just use a shared mount point on your subdomains ? The customers don't need to contact support for that.


    Example:

    - primary domain xxxyyyzzz.com -> /var/www/virtual/xxxyyyzzz.com/htdocs

    - subdomain de.xxxyyyzzz.com -> xxxyyyzzz.com

    - subdomain fr.xxxyyyzzz.com -> xxxyyyzzz.com

    - subdomain it.xxxyyyzzz.com -> xxxyyyzzz.com

    and so on...

    For those who can't wait for the next release, for those who know what they are doing, for those who understand how to use the root user and its power, for those who are able to recover a broken system, there's a quick and dirty method to add php7.2 and php7.3 to the phpswitcher plugin.


    Keep in mind that:

    - not all the modules are compiled, just the modules for my needs

    - there could be some errors (I'm sure there are)

    - this is only "tested" on Debian 9 amd64 with my personal configuration (standard) that could differ from yours

    - you know what you are doing

    - THERE IS NO SUPPORT

    - just to be clear, THERE IS NO SUPPORT


    So, let's begin:

    1. Install dependencies:

    Code
    1. apt install libzip-dev libopenmpi-dev libc6-dev libnewlib-dev valgrind libarb-dev libxml2-dev libsodium-dev libpth-dev libzfslinux-dev makedev

    2. Link some needed libraries:

    Code
    1. ln -s /usr/lib/libc-client.a /usr/lib/x86_64-linux-gnu/libc-client.a
    2. cd /usr/include
    3. ln -s x86_64-linux-gnu/curl

    FOR PHP 7.2


    There's only modules.ini missing now, we need to "build" it:

    Code
    1. ls -1 /opt/phpswitcher/$compDate/php7.2/lib/php/20170718-zts-debug/ | grep .so > /opt/phpswitcher/$compDate/php7.2/etc/php/conf.d/modules.ini
    2. sed -i -e 's/^/extension = /' /opt/phpswitcher/$compDate/php7.2/etc/php/conf.d/modules.ini
    3. sed -i 's/extension = opcache.so/zend_extension = opcache.so/g' /opt/phpswitcher/$compDate/php7.2/etc/php/conf.d/modules.ini

    Last Step:

    edit file /opt/phpswitcher/$compDate/php7.2/etc/php/conf.d/modules.ini with your favorite editor and

    1. invert lines mysqli.so and mysqlnd.so

    2. move opcache.so to top (first line) of the file


    edit file /opt/phpswitcher/$compDate/php7.2/etc/php-fpm.conf with your favorite editor and change what follows:

    Code
    1. ;pid = run/php-fpm.pid => pid = /var/run/phpswitcher/psw7.2-fpm.pid
    2. ;error_log = log/php-fpm.log => error_log = /var/log/phpswitcher/psw7.2-fpm.log
    3. ;syslog.ident = php-fpm => syslog.ident = psw7.2-fpm
    4. ;emergency_restart_threshold = 0 => emergency_restart_threshold = 10
    5. ;emergency_restart_interval = 0 => emergency_restart_interval = 1m
    6. ;process_control_timeout = 0 => process_control_timeout = 60s
    7. ;daemonize = yes => daemonize = yes

    edit file /opt/phpswitcher/$compDate/php7.2/etc/php/php.ini with your favorite editor and change what follows:

    Code
    1. short_open_tag = Off => short_open_tag = On
    2. ;cgi.fix_pathinfo=1 => cgi.fix_pathinfo=1

    FOR PHP 7.3

    There's only modules.ini missing now, we need to "build" it:

    Code
    1. ls -1 /opt/phpswitcher/$compDate/php7.3/lib/php/20180731-zts-debug/ | grep .so > /opt/phpswitcher/$compDate/php7.3/etc/php/conf.d/modules.ini
    2. sed -i -e 's/^/extension = /' /opt/phpswitcher/$compDate/php7.3/etc/php/conf.d/modules.ini
    3. sed -i 's/extension = opcache.so/zend_extension = opcache.so/g' /opt/phpswitcher/$compDate/php7.3/etc/php/conf.d/modules.ini

    Last Step:

    edit file /opt/phpswitcher/$compDate/php7.3/etc/php/conf.d/modules.ini with your favorite editor and

    1. invert lines mysqli.so and mysqlnd.so

    2. move opcache.so to top (first line) of the file


    edit file /opt/phpswitcher/$compDate/php7.3/etc/php-fpm.conf with your favorite editor and change what follows:

    Code
    1. ;pid = run/php-fpm.pid => pid = /var/run/phpswitcher/psw7.3-fpm.pid
    2. ;error_log = log/php-fpm.log => error_log = /var/log/phpswitcher/psw7.3-fpm.log
    3. ;syslog.ident = php-fpm => syslog.ident = psw7.3-fpm
    4. ;emergency_restart_threshold = 0 => emergency_restart_threshold = 10
    5. ;emergency_restart_interval = 0 => emergency_restart_interval = 1m
    6. ;process_control_timeout = 0 => process_control_timeout = 60s
    7. ;daemonize = yes => daemonize = yes


    edit file /opt/phpswitcher/$compDate/php7.3/etc/php/php.ini with your favorite editor and change what follows:

    Code
    1. short_open_tag = Off => short_open_tag = On
    2. ;cgi.fix_pathinfo=1 => cgi.fix_pathinfo=1


    After each step read what your console output tells you, if everything is ok, go to the next step.

    To finish:

    Go to your i-MSCP Panel and add the 2 new version as you will do with a "normal" version


    Hope it helps.