• Resolved nbi1

    (@nbi1)


    Got installer error:

    SESSION variable ‘max_allowed_packet’ is read-only. Use SET GLOBAL to assign the value

    Trace:
    #0 /var/www/html/dup-installer/ctrls/ctrl.s2.dbinstall.php(60): mysqli_query()
    #1 /var/www/html/dup-installer/ctrls/ctrl.s2.base.php(139): DUPX_DBInstall->__construct()
    #2 /var/www/html/dup-installer/main.installer.php(230): require_once('...')
    #3 {main}

    Lines 59 and 60 of dbinstall.php are:
    @mysqli_query($this->dbh, “SET GLOBAL max_allowed_packet = “.mysqli_real_escape_string($this->dbh, $GLOBALS[‘DB_MAX_PACKETS’]));
    @mysqli_query($this->dbh, “SET max_allowed_packet = “.mysqli_real_escape_string($this->dbh, $GLOBALS[‘DB_MAX_PACKETS’]));

    What??? What is the intent? Unless I’m dyslexic these 2 queries are identical with the only difference that the first one uses ‘GLOBAL’. From the trace we can see that the use of GLOBAL does indeed work. So what is the purpose of line 60? I can’t even speculate. Is it’s presence an error, can it be deleted? Some research on max_allowed_packet revealed that it hasn’t always been read-only. But even if that is true what is the purpose of these 2 consecutive queries?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter nbi1

    (@nbi1)

    As an experiment I commented out line 60. Line 85 also required ‘GLOBAL’. With these 2 changes the installer completed successfully. Hopefully the installation isn’t hosed, at least according to the installer there were no problems (with these fixes in place).

    Cory Lamle

    (@corylamleorg)

    Hi @nbi1,

    Which version of the plugin are you using? There was a patch placed in 1.4.4 for that issue on PHP 8.1.

    Here is the code that addresses that issue.
    https://plugins.svn.www.ads-software.com/duplicator/tags/1.4.4/installer/dup-installer/ctrls/ctrl.s2.dbinstall.php

    Let me know if that helps~

    Thread Starter nbi1

    (@nbi1)

    Thanks, I’ll check that out.

    How do I check the plugin version in a scenario like this where the installer hasn’t completed yet? Can’t go to the WP dashboard because installation hasn’t finished. wp-cli can’t help because the dashboard isn’t available. Is your plugin version a string in one of the files?

    Cory Lamle

    (@corylamleorg)

    Hi @nbi1,

    You can see the version from a few different places

    1. The WP Admin > Packages > Package Details > General Section
    2. In the installer at the very top of the screen
    3. If the installer bootstrap has issues loading inside /dup-installer/dup-archive__[hash].txt with the label “version_dup”: “1.4.4” should also show it.

    Hope that helps~

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘SESSION variable ‘max_allowed_packet’ is read-only’ is closed to new replies.